Process.Close() is not terminating created process,c#

前端 未结 3 1027
走了就别回头了
走了就别回头了 2020-11-29 12:05

I\'ve written a C# application which uses System.Diagnostics.Process class to create a process, using

 Process P1 = new Process();
 P1.FileName         


        
3条回答
  •  情深已故
    2020-11-29 12:33

    Process.Close() isn't meant to abort the process - it's just meant to release your "local" view on the process, and associated resources.

    I think you mean Process.Kill() or Process.CloseMainWindow(). Personally I'd try to find a more graceful way of shutting it down though.

提交回复
热议问题