Detecting a previous instance...

  • Thread starter Thread starter agro_r
  • Start date Start date
A

agro_r

I don't want more than one instance of my program running in a
particular user. How can I do that in .NET?

Thanks a lot...
 
using System.Diagnostics;

Process.GetProcessesByName(Process.GetCurrentProcess.ProcessName)

If the returned array length is not zero then you have a previous instance.
 
Back
Top