Make a .net desktop application single instance
Here's how you can do it in Program.cs --> Main
static void Main()
{
if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length >1)
{
MessageBox.Show("Turbobroker is already running.");
return;
}
Application.Run(new Form1());
}
}
Comments