Run only one instance from you program
Use this function in Program.Main()private static bool IsAlreadyRunning(){ //Find name of current process string currentProcessName = Process.GetCurrentProcess().ProcessName; //Find the name of all processes having current process name Process[]...
Use this function in Program.Main()
private static bool IsAlreadyRunning() { //Find name of current process string currentProcessName = Process.GetCurrentProcess().ProcessName; //Find the name of all processes having current process name Process[] processesNamesCollection = Process.GetProcessesByName(currentProcessName); //Check whether more than one process is running if (processesNamesCollection.Length > 1) return true; else return false; }