private void Restart() { Thread thtmp = new Thread(new ParameterizedThreadStart(run)); object appName = Application.ExecutablePath; Thread.Sleep(2000); thtmp.Start(appName); }
private void run(Object obj) { Process ps = new Process(); ps.StartInfo.FileName = obj.ToString(); ps.Start(); }
点击事件调用方法:
Application.ExitThread();
Restart();