there are many ways, here is a simple one:Mutex mutex = new Mutex(false, "Thisshouldonlyrunonce");
bool Running = !mutex.WaitOne(0, false);
if (Running)
// exit program, or ....
bool Running = !mutex.WaitOne(0, false);
if (Running)
// exit program, or ....
解决方案 »
- 开发一个界面,能够按某种要求随机出现图案,
- C# SerialPort 没有paritycheck属性
- 局域网通讯
- 定义Lable数组是这样定义的吗? Label[] l = new Label();
- windows服务程序一次只能启动一个服务的问题
- image怎么缩小图片后显示?
- TabControl和TreeView的综合使用问题
- 连续问几个问题之一:如何关闭子窗体?不识MDI窗体。是Show出来的窗体
- 一个变量string stra=“100*25-152” ,怎么能得到stra的运算结果
- VS上面的打包程序[installshield limited edition project]做覆盖安装包的问题
- help:如何在c#中用ipx协议联结两部机器?
- 运行时候报错:这会使集合中的两个绑定绑定到同一个属性。怎么解决
......
......
Process[] a=System.Diagnostics.Process.GetProcessesByName("你的程序名字");
if(a.Length>1)
{
Console.WriteLine("yirunxing");
return;
}