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.ProcessName).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
|