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 に答える