C#实现程序启动唯一实例的一种方法
来源:互联网 发布:电脑usb端口无法识别 编辑:程序博客网 时间:2024/05/18 16:36
private static void GetSingleThread()
{
string name = Process.GetCurrentProcess().ProcessName;
int id = Process.GetCurrentProcess().Id;
Process[] nProcess = Process.GetProcesses();
foreach(Process process in nProcess )
{
if ((name == process.ProcessName) && (process .Id != id))
{
MessageBox.Show("对不起,本地已经有系统正在运行!\n.","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
System.Environment.Exit(0);
}
}
}
{
string name = Process.GetCurrentProcess().ProcessName;
int id = Process.GetCurrentProcess().Id;
Process[] nProcess = Process.GetProcesses();
foreach(Process process in nProcess )
{
if ((name == process.ProcessName) && (process .Id != id))
{
MessageBox.Show("对不起,本地已经有系统正在运行!\n.","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
System.Environment.Exit(0);
}
}
}
- c#实现程序启动唯一实例的一种方法
- c#实现程序启动唯一实例的一种方法
- C#实现程序启动唯一实例的一种方法
- c#实现程序启动唯一实例的方法
- C#实现程序开机启动的方法
- 实现程序唯一实例运行
- 实现启动动画的一种方法
- 在C#中启动另一个程序的实现方法
- 【用C#实现启动另一程序的方法】
- Qt4.8单实例启动的一种方法
- 一种只允许程序的一个实例运行的方法
- 启动唯一实例
- C# 实现程序的开机启动
- 一种c#实现的函数互斥的方法
- C#中实现读/写文件(一种常用的方法)...
- C#实现窗体圆角的一种方法
- C#实现窗体圆角的一种方法
- 程序实例唯一
- python编码与反编码 decode('unicode-escape')
- 带头结点的链队列实现(C语言)
- 用Visual studio11在Windows8上开发驱动实现注册表监控和过滤
- 笔试题:创建一个单链表,结点包含学生的学号,姓名,性别,年龄信息.写几个程序,实现按学生学号插入,查询,删除等操作.
- seleniumIDE+firebug+seleniumRC
- C#实现程序启动唯一实例的一种方法
- mastudio 从晚上获取表格
- Cocos2d-x初入学堂(3)-->TexturePacker非常棒的图像处理工具
- mysql reading initial communication packet
- mastudio 下载附件
- 悲喜一瞬间,此悲伤非彼悲伤:伤感日志
- 結合 Selenium RC
- Autogrow of file '******' in database '******' was cancelled by user or timed out after ****** milli
- 用Visual studio11在Windows8上开发驱动实现内存填0杀进程