using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;

namespace ExecuteADB
{
public partial class Form1 : Form
{
//声明变量
string preimei, imei;
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

}

/// <summary>
/// 点击获取IMEI 号码
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
String cmd = Application.StartupPath + "\\adb\\adb.exe";
Process p = new Process();
p.StartInfo = new System.Diagnostics.ProcessStartInfo();
p.StartInfo.FileName = cmd;//设定程序名
p.StartInfo.Arguments = " shell getprop ro.product.model";
p.StartInfo.UseShellExecute = false; //关闭shell的使用
p.StartInfo.RedirectStandardInput = true; //重定向标准输入
p.StartInfo.RedirectStandardOutput = true; //重定向标准输出
p.StartInfo.RedirectStandardError = true; //重定向错误输出
p.StartInfo.CreateNoWindow = true;//设置不显示窗口
p.Start();
label2.Text = p.StandardOutput.ReadToEnd();
p.Close();
///////////////////////////
p.StartInfo = new System.Diagnostics.ProcessStartInfo();
p.StartInfo.FileName = cmd;//设定程序名
p.StartInfo.Arguments = " shell dumpsys iphonesubinfo";
p.StartInfo.UseShellExecute = false; //关闭shell的使用
p.StartInfo.RedirectStandardInput = true; //重定向标准输入
p.StartInfo.RedirectStandardOutput = true; //重定向标准输出
p.StartInfo.RedirectStandardError = true; //重定向错误输出
p.StartInfo.CreateNoWindow = true;//设置不显示窗口
p.Start();
preimei = p.StandardOutput.ReadToEnd();

//string[] sArray = preimei.Split(new char[1] { '=' });
//imei = sArray[2];
//textBox1.Text = imei.Trim();
//p.Close();
}
}
}

最新文章

  1. Axure 8.0.0.3312可用注册码
  2. 怎么向Xcode6 IOS8之后向项目中添加预编译文件
  3. Target runtime Apache Tomcat v6.0 is not defined
  4. Tomcat 搭配 Nginx 还是 Apache 呢?
  5. C++中 模板Template的使用
  6. ng-cookie 的基本使用
  7. sql 列轉行、行轉列
  8. 3、第3课CSS块级、行内元素、绝对定位、相对定位、固定位置20150922
  9. java整合flex
  10. wxWidgets显示视频
  11. shell脚本报错:&quot;[: =: unary operator expected&quot;
  12. PHP进阶,使用交互模式进行快速测试实验?
  13. $cordovaCamera 插件 上传头像 图片功能
  14. Linux性能工具图册-便于查阅
  15. JavaScript 中的正则表达式
  16. nginx &amp;&amp; apache 图片代理
  17. python学习 day19 configparser模块 os模块 subprocess模块
  18. CAN设计与应用指南
  19. Genymotion模拟器无法开启的解决方法——Unable to start the virtual device,The virtual device got no IP address
  20. [POI2008]STA-Station

热门文章

  1. 实现用http上传文件,用ftp下载文件
  2. 主席树【bzoj3524(p3567)】[POI2014]Couriers
  3. 51nod 更难的矩阵取数问题(动态规划)
  4. Track Cylinder
  5. 【动态规划】bzoj1649 [Usaco2006 Dec]Cow Roller Coaster
  6. python3 开发面试题(%s和format的区别)5.31
  7. 通读《STL源码剖析》之后的一点读书笔记
  8. Problem J: 求方程的解——C语言初学者百题大战之十五
  9. 读取SequenceFile中自定义Writable类型值
  10. ToggleButton控件,Switch控件