// 获取dll路径
string sLocation = System.Reflection.Assembly.GetExecutingAssembly().Location;
string sLocation = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
// 获取应用程序路径
string sLocation = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
string sPath = System.Windows.Forms.Application.ExecutablePath;
// 强制退出进程
System.Diagnostics.Process.GetCurrentProcess().Kill();
System.Environment.Exit(0);
// 启动进程
System.Diagnostics.Process.Start(sPath);
// 仅对winform窗口有效的重启
System.Windows.Forms.Application.Restart();
获取dll、exe路径,退出、启动、重启程序
最新推荐文章于 2025-05-16 14:43:03 发布