0
此錯誤從未發生過。這是我的代碼;process_OutputDataReceived沒有超載與委託相匹配System.Diagnostics.DataReceivedEventHandler
private Process process = null;
private void button5_Click(object sender, EventArgs e)
{
if (null != process)
{
process.Dispose();
}
process = new Process();
process.StartInfo.FileName = "world.exe";
process.StartInfo.Arguments = "";
process.StartInfo.UseShellExecute = false;
process.EnableRaisingEvents = true;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.RedirectStandardOutput = true;
process.OutputDataReceived += new DataReceivedEventHandler(process_OutputDataReceived);
process.Exited += new EventHandler(process_Exited);
process.Start();
process.BeginOutputReadLine();
}
private void process_OutputDataReceived(object sender, DataReceivedEventArgs e)
{
}
以下是我對得到一個錯誤:
process.OutputDataReceived += new DataReceivedEventHandler(process_OutputDataReceived);
,上面是罰款,直到我寫了;
private void process_OutputDataReceived(object sender, DataReceivedEventArgs e)
{
}
幫助將不勝感激。不知道這可能是如何具體比它是。
感謝萌芽狀態。它現在有效。 ;) –
優秀!記住,在這個網站上點擊複選框和向上箭頭可以幫助你解決問題,或者幫助你解決問題,這樣未來的訪問者知道哪個答案可以幫助你。 –