我有問題,當在「波浪」返回控制檯輸出。例如,控制檯每秒都會輸出一些內容,例如事件每分鐘觸發60次(同時觸發所有事件)。閱讀等過程控制檯輸出
我的代碼:
Process Proc = new Process();
Proc.StartInfo.FileName = SSMS.BinaryDir + "HldsUpdateTool.exe";
Proc.StartInfo.Arguments = "-command update -game tf -dir " + SSMS.RootDir + Key;
Proc.StartInfo.UseShellExecute = false;
Proc.StartInfo.RedirectStandardOutput = true;
Proc.StartInfo.RedirectStandardError = true;
Proc.EnableRaisingEvents = true;
Proc.StartInfo.CreateNoWindow = false;
Proc.ErrorDataReceived += new DataReceivedEventHandler(Proc_ErrorDataReceived);
Proc.OutputDataReceived += new DataReceivedEventHandler(Proc_OutputDataReceived);
Proc.Exited += new EventHandler(Proc_Exited);
Proc.Start();
Proc.BeginErrorReadLine();
Proc.BeginOutputReadLine();
我可能會懷疑存在與更新工具的問題。其他程序與控制檯輸出工作正常。
在時間線當事件被觸發:(=什麼也沒發生; |觸發的事件)
Should be: ==|==|==|==|==|==|==
Is: ========|||||||=========||||||=====
我認爲你必須刷新輸出。不知道怎麼回事 – BlackBear 2011-03-19 12:50:58