using System.Threading;
متود Main از کلاس StartUp پروژه رو به این شکل تغییر بدید :
[STAThread]
static void Main()
{
bool ok;
Mutex m = new Mutex(true, "YourNameHere", out ok);
if (! ok)
{
MessageBox.Show("Another instance is already running.");
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(fals e);
Application.Run(new Form1()); // or whatever was there
GC.KeepAlive(m); // important!
}
منبع : http://www.ai.uga.edu/mc/SingleInstance.html