(小技巧六)只允许一个进程运行winform
2005-02-03 17:08
316 查看
static void Main()
// get the name of our process
string proc=Process.GetCurrentProcess().ProcessName;
// get the list of all processes by that name
Process[] processes=Process.GetProcessesByName(proc);
// if there is more than one process if (processes.Length > 1)
MessageBox.Show("Application is already running");
return;
} else
Application.Run(new Form1());
}
// get the name of our process
string proc=Process.GetCurrentProcess().ProcessName;
// get the list of all processes by that name
Process[] processes=Process.GetProcessesByName(proc);
// if there is more than one process if (processes.Length > 1)
MessageBox.Show("Application is already running");
return;
} else
Application.Run(new Form1());
}
相关文章推荐
- (小技巧六)只允许一个进程运行winform
- (小技巧六)只允许一个进程运行winform
- 只允许一个进程运行winform
- winform只允许一个应用程序运行
- winform 判断程序是否已经运行,提示“只允许运行一个程序”
- C# WinForm只允许运行一个窗体实例
- C# winform只允许一个进程运行
- winform只允许一个应用程序运行
- C# 只能运行一个winForm进程
- C# 只能运行一个WinForm进程
- C# WinForm 只允许运行一个实例 ,如果有就激活到前段
- winform 里同一个程序只允许运行一次
- C# Winform程序只允许运行一个实例
- WinForm判断程序是否已经在运行,且只允许运行一个实例
- C#程序双击运行之后,界面不显示,但是在任务管理器有进程(一个winform找bug之旅)
- c#中总是提示“在代码运行时或者在禁用“只要一个进程中断,就中断所有进程”选项时,不允许进行更改。
- 只允许运行一个进程
- 【框架-MFC】MFC 实现单例进程,只允许一个程序运行
- C#_WinForm程序只允许运行一个实例
- Winform程序只允许运行一个程序实例