Detect Concurrent Running Instances

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

I do not want multiple instances of a vb.net program running concurrently...
How may I detect this ?

Thanks
 
If you are using VS 2005, this is actually a project setting. You just check
of a checkbox, and you are all done.
 
If
UBound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0 Then
' MsgBox("Application is already running...",
MsgBoxStyle.Information, Application.ProductName)
ActivatePrevInstance("frmswitchboard")
end if
 
I do not want multiple instances of a vb.net program running
concurrently... How may I detect this ?

If you just want to make sure you don't start another instance of an app,
you can use the GetProcessesByName. There can be issues with this, particularly
in a Terminal Server environment however. Search on "Single Instance" for
more information. My write up with a VB solution is available at http://devauthority.com/blogs/jwooley/archive/2005/07/28/318.aspx.


Jim Woole
 

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