0

我尝试向 cmd 发送推荐并获取输出。我确定它已发送,但我无法获得输出。

 ProcessStartInfo startinfo = new ProcessStartInfo();
        startinfo.FileName = @"C:\Users\mehmetcan\Desktop\adt-bundle-windows-x86-20130917\sdk\platform-tools\adb.exe";
        startinfo.Arguments = @"devices";
        startinfo.RedirectStandardOutput = true;
        startinfo.RedirectStandardError = true;
        startinfo.UseShellExecute = false;

        // Note: declare process as a variable in the class as it needs to be used in the event handlers
        process = new Process();
        process.StartInfo = startinfo;

它返回:“123456 devices”如何在字符串中获取它?

4

1 回答 1

1

你应该通过阅读它

string output = process.StandardOutput.ReadToEnd();
于 2013-10-26T20:06:34.013 回答