C#实现重启应用程序 收藏
using    System.Diagnostics;  
   string    strAppFileName=Process.GetCurrentProcess().MainModule.FileName;  
   Process    myNewProcess=new    Process();  
   myNewProcess.StartInfo.FileName=strAppFileName;  
   myNewProcess.StartInfo.WorkingDirectory=Application.ExecutablePath;  
   myNewProcess.Start();  
   Application.Exit();  

或者

if    (    MessageBox.Show("要重新启动嘛?","提示", MessageBoxButtons.YesNoCancel,  
   MessageBoxIcon.Question)    ==    DialogResult.Yes)  
   System.Diagnostics.Process.Start(System.Reflection.Assembly.GetExecutingAssembly().Location); 

相关文章:

  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
  • 2021-12-02
  • 2021-10-04
  • 2021-08-30
  • 2022-12-23
猜你喜欢
  • 2021-08-06
  • 2021-09-13
  • 2021-05-20
  • 2022-12-23
  • 2022-12-23
  • 2021-06-27
  • 2022-12-23
相关资源
相似解决方案