现在要获取adb的错误异常吗?
例如,如果未连接richtextbox
的adb设备未连接任何设备并且未在richtextbox
中写入任何内容,或者如果已连接的设备richtextbox
写入了ok数据,则显示有关以下内容的所有信息命令
这是我的代码:
// START READ INFO//
//MANFactURE//
using (Process process = new Process())
{
ProcessStartInfo startInfo = new ProcessStartInfo
{
WindowStyle = ProcessWindowStyle.Hidden,CreateNoWindow = true,UseShellExecute = false,RedirectStandardOutput = true,FileName = "adb.exe",Arguments = " shell getprop ro.product.manufacturer"
};
process.StartInfo = startInfo;
process.Start();
process.StartInfo.RedirectStandardError = true;
Sks.Text = process.StandardOutput.ReadToEnd();
string b = "MANUFactURE :" + Sks.Text;
progressBar1.Value = 0;
progressBar1.Minimum = 0;
progressBar1.Maximum = 15;
progressBar1.Step = 1;
for (int i = 0; i < 100; i++)
{
progressBar1.PerformStep();
}
// SECURITY PATCH //
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.FileName = "adb.exe";
startInfo.Arguments = "shell getprop ro.build.version.security_patch";
process.StartInfo = startInfo;
process.Start();
Sks.Text = process.StandardOutput.ReadToEnd();
string E = Environment.NewLine + "SECURITY PATCH :" + Sks.Text;
string s = Sks.Text = b + E;