1

アプリAを実行していて、プロセス開始を使用して別のアプリBを起動します。アプリBのトレース情報を取得することはできますか?

4

1 に答える 1

1

StandardOutput をキャプチャできます。MSDN ドキュメントから:

// Start the child process.
 Process p = new Process();
 // Redirect the output stream of the child process.
 p.StartInfo.UseShellExecute = false;
 p.StartInfo.RedirectStandardOutput = true;
 p.StartInfo.FileName = "Write500Lines.exe";
 p.Start();
 // Do not wait for the child process to exit before
 // reading to the end of its redirected stream.
 // p.WaitForExit();
 // Read the output stream first and then wait.
 string output = p.StandardOutput.ReadToEnd();
 p.WaitForExit();

したがって、読み取りStandardOutput(および/またはStandardError) によって、起動したばかりのプロセスの出力をキャプチャできます。

于 2013-02-25T07:51:09.170 に答える