public partial class App : Application
{
System.Threading.Mutex mutex; public App()
{
this.Startup += new StartupEventHandler(App_Startup);
} void App_Startup(object sender, StartupEventArgs e)
{
bool ret;
mutex = new System.Threading.Mutex(true, "WpfMuerterrrterterttex", out ret);
if (!ret)
{
MessageBox.Show("Program has started, you can't start again!");
Environment.Exit(0);
}
}
}
欢迎访问:http://121.18.78.216 适易查询分析、工作流、内容管理及项目管理演示平台
标签:启动,App,Startup,控制程序,ret,System,Mutex,mutex,WPF From: https://blog.51cto.com/u_14751752/5868348