2009-08-16 80 views

回答

1

不是100%確定我完全明白你想要做什麼 - 這會有幫助嗎?

Process process = new Process(); 

process.StartInfo.RedirectStandardOutput = true; 
process.OutputDataReceived += 
    new DataReceivedEventHandler(HandleConsoleOutput); 

process.Start(); 

,然後處理所有的輸出正在由進程使用此處理程序寫入到控制檯輸出:

void HandleConsoleOutput(object sender, DataReceivedEventArgs e) 
{ 
    // Std output arrives here 
} 

馬克

+0

通知的WINAPI標籤:) thanx的樣品,無論如何,它讓我記得我有一個類似API的代碼... – majkinetor 2009-08-18 11:34:10

相關問題