Visual C# GUI stops responding when process.WaitForExit(); is used

后端 未结 6 1805
臣服心动
臣服心动 2020-12-12 01:14

I am creating a GUI application using Visual C# 2005 (net framework 2). I use the following code to start a process:

Process process = new Process();
process         


        
6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-12 01:27

    Your waiting for the process on the only thread of your application that is also responsible for handling all GUI events. If you want to wait for some event (like some other process to finish) and still have your code notified of the event then you have to wait on another thread or use an event handler.

提交回复
热议问题