資源簡介
C#開發的通過ADB控制連接的手機,模擬點擊按鈕,輸入數字和英文內容,初學ADB開發使用的極具參考價值,附有相關資料文檔一份、CS2010下通過

代碼片段和文件信息
using?System;
using?System.IO;
using?System.Text;
using?System.Data;
using?System.Linq;
using?System.Drawing;
using?System.Threading;
using?System.Diagnostics;
using?System.Windows.Forms;
using?System.ComponentModel;
using?System.Collections.Generic;
using?System.Runtime.InteropServices;
using??System.Text.Regularexpressions;
using?PhoneFixtureLib;
using?CE.iPhone.PList;
namespace?AdbApp
{
????public?partial?class?Form1?:?Form
????{
????????public?delegate?void?delegateHandler(string?responseStr);
????????public?delegateHandler?handle;
????????AutoResetEvent?autoReset?=?new?AutoResetEvent(false);
????????ADBCommandClass?adbObj;
????????public?Form1()
????????{
????????????InitializeComponent();
????????????this.Text?=?System.Reflection.Assembly.GetExecutingAssembly().GetName().Name?+?“?Ver.“?+
????????????????System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????adbObj?=?new?ADBCommandClass(new?ADBCommandClass.MessageOutputDelegate(this.ShowResultLine));
????????????this.Load_Command();
????????????this.ADBEnvironmentCheck();
????????}
????????private?void?Form1_FormClosing(object?sender?FormClosingEventArgs?e)
????????{
????????????try
????????????{
????????????????foreach?(Process?p?in?Process.GetProcessesByName(“adb“))
????????????????{
????????????????????p.Kill();
????????????????}
????????????}
????????????catch
????????????{
????????????}
????????}
????????private?void?Load_Command()
????????{
????????????this.listBox1.Items.Clear();
????????????PListRoot?root?=?PListRoot.Load(Properties.Settings.Default.CommandFile);
????????????PListDict?dic?=?(PListDict)root.Root;
????????????PListArray?arr?=?(PListArray)dic[“array“];
????????????for?(int?i?=?0;?i?????????????????listBox1.Items.Add(((PListString)arr[i]).Value);
????????}
????????private?void?ADBEnvironmentCheck()
????????{
????????????try
????????????{
????????????????bool?isExist?=?true;
????????????????string?pathlist?=?Environment.GetEnvironmentVariable(“PATH“);
????????????????if?(pathlist?==?null)
????????????????????isExist?=?false;
????????????????else
????????????????{
????????????????????isExist?=?false;
????????????????????string[]?list?=?pathlist.Split(‘;‘);
????????????????????foreach?(string?variable?in?list)
????????????????????{
????????????????????????foreach?(string?key?in?PathKey)
????????????????????????{
????????????????????????????if?(variable.ToLower().Contains(key))
????????????????????????????{
????????????????????????????????isExist?=?true;
????????????????????????????????break;
????????????????????????????}
????????????????????????}
????????????????????}
????????????????}
????????????????if?(!isExist)
????????????????{
????????????????????string?system32?=?System.Environment.SystemDirectory;
????????????????????string[]?file
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????61??2015-01-10?17:50??ADBTest\.git\COMMIT_EDITMSG
?????文件????????356??2015-01-08?14:20??ADBTest\.git\config
?????文件?????????73??2015-01-08?14:19??ADBTest\.git\desc
?????文件?????????23??2015-01-08?14:20??ADBTest\.git\HEAD
?????文件????????452??2015-01-08?14:19??ADBTest\.git\hooks\applypatch-msg.sample
?????文件????????896??2015-01-08?14:19??ADBTest\.git\hooks\commit-msg.sample
?????文件????????189??2015-01-08?14:19??ADBTest\.git\hooks\post-update.sample
?????文件????????398??2015-01-08?14:19??ADBTest\.git\hooks\pre-applypatch.sample
?????文件???????1642??2015-01-08?14:19??ADBTest\.git\hooks\pre-commit.sample
?????文件???????1352??2015-01-08?14:19??ADBTest\.git\hooks\pre-push.sample
?????文件???????4951??2015-01-08?14:19??ADBTest\.git\hooks\pre-reba
?????文件???????1239??2015-01-08?14:19??ADBTest\.git\hooks\prepare-commit-msg.sample
?????文件???????3611??2015-01-08?14:19??ADBTest\.git\hooks\update.sample
?????文件???????2208??2015-01-16?16:55??ADBTest\.git\index
?????文件????????240??2015-01-08?14:19??ADBTest\.git\info\exclude
?????文件???????1067??2015-01-10?17:50??ADBTest\.git\logs\HEAD
?????文件???????1067??2015-01-10?17:50??ADBTest\.git\logs\refs\heads\master
?????文件????????204??2015-01-08?14:20??ADBTest\.git\logs\refs\remotes\origin\HEAD
?????文件????????795??2015-01-10?17:50??ADBTest\.git\logs\refs\remotes\origin\master
?????文件????????165??2015-01-08?17:38??ADBTest\.git\ob
?????文件????????278??2015-01-08?14:20??ADBTest\.git\ob
?????文件????????206??2015-01-08?14:20??ADBTest\.git\ob
?????文件??????32307??2015-01-08?17:25??ADBTest\.git\ob
?????文件????????130??2015-01-08?14:20??ADBTest\.git\ob
?????文件???????4323??2015-01-08?14:20??ADBTest\.git\ob
?????文件????????165??2015-01-08?17:38??ADBTest\.git\ob
?????文件????????214??2015-01-10?17:50??ADBTest\.git\ob
?????文件???????4664??2015-01-08?14:20??ADBTest\.git\ob
?????文件????????289??2015-01-08?17:25??ADBTest\.git\ob
?????文件????????191??2015-01-10?17:50??ADBTest\.git\ob
............此處省略288個文件信息
- 上一篇:c#試卷自動生成系統
- 下一篇:asp.net 購物網站
評論
共有 條評論