发布:2015/3/22 9:55:30作者:管理员 来源:本站 浏览次数:2161
方法都差不多,都是先重启一个进程,然后关闭当前的进程。
// Restart current process Method 1
System.Windows.Forms.Application.Restart();
Application.Current.Shutdown();
// Restart current process Method 2
System.Reflection.Assembly.GetEntryAssembly();
string startpath = System.IO.Directory.GetCurrentDirectory();
System.Diagnostics.Process.Start(startpath + "\\xxx.exe");
Application.Current.Shutdown();
// Restart current process Method 3
Process p = new Process();
p.StartInfo.FileName = System.AppDomain.CurrentDomain.BaseDirectory + "xxx.exe";
p.StartInfo.UseShellExecute = false;
p.Start();
Application.Current.Shutdown();
© Copyright 2014 - 2025 柏港建站平台 ejk5.com. 渝ICP备16000791号-4