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

前端 未结 3 1014
走了就别回头了
走了就别回头了 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:24

    I think Process.Kill() is what you're looking for.

    0 讨论(0)
  • 2020-11-29 12:31

    Use Process.Kill instead.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题