Richard Kreidl
asked on
Check for a previous instance of an app on a network?
I found the code below on how to check for a previous instance of an app, but I don't think this will work for a network executeable. So, how do you check to see if there is multiple instances of an executeable running on a network?
Public Sub CheckForExistingInstance()
'Get number of processes of you program
If Process.GetProcessesByName _
(Process.GetCurrentProcess .ProcessNa me).Length > 1 Then
MessageBox.Show _
("Another Instance of this process is already running", _
"Multiple Instances Forbidden", _
MessageBoxButtons.OK, _
MessageBoxIcon.Exclamation )
Application.Exit()
End If
End Sub
Public Sub CheckForExistingInstance()
'Get number of processes of you program
If Process.GetProcessesByName
(Process.GetCurrentProcess
MessageBox.Show _
("Another Instance of this process is already running", _
"Multiple Instances Forbidden", _
MessageBoxButtons.OK, _
MessageBoxIcon.Exclamation
Application.Exit()
End If
End Sub
By network executable, are you referring to an exe that sits on a network drive, and is run on the client machines, or do all instances run on the network server?
ASKER
The exe sits on a network drive and is run on the client machines.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you want to check if the same application should not run on the client machine again. But may run on any other network computer Then the above mentioned code will run..
Otherwise the only solution is what is suggested by platinumbay
Otherwise the only solution is what is suggested by platinumbay