When you run an application its instance is created in process
so if you need to see that its instance already running
string procName = Process.GetCurrentProcess().ProcessName;
if (Process.GetProcessesByName(procName).Length == 1)
{
...code here...
}
Or you can directly set it from Project properties
Preventing multiple instances of .Net Applicationl[
^]
You can do it in any of the way