Click here to Skip to main content
15,921,774 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
so bascicly you release your program as an .exe you can open it more then once, I was wondering how to make it so you can only have one of the program open, so that the user cannot open the program more then once just like "Skype"
Posted

When you run an application its instance is created in process
so if you need to see that its instance already running
C#
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
 
Share this answer
 
v2
Please refer links:
Link1
Link2
Link3
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900