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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top