For dealing with this kind of problems there is a class called Mutex, here is an example:
Code:
static void Main()
{
s_mutex = new Mutex(true,Assembly.GetExecutingAssembly().GetName().Name);
if (s_mutex.WaitOne(0, false))
{
Application.Run(new WinForm());
}
else
MessageBox.Show("already an instance of app running!","Attention");
Leave a comment: