c# console 自动重启

来源:互联网 发布:rar解压 for mac 编辑:程序博客网 时间:2024/05/01 18:55

那天写重启,只用了     Application.Restart() ,发现不是重启,而是重新启动了一个窗体。问题来了,肯定是原窗体里有的进程没有关闭,给人的感觉是重新启动了一个程序。再加上System.Diagnostics.Process.GetCurrentProcess().Kill(),这一句吧,哦了!

一起使用:

  Application.Restart() ;

System.Diagnostics.Process.GetCurrentProcess().Kill();


原创粉丝点击