Hello everyone.
I'm used to doing this in VB.NET 2003:
Now, the purpose of the above code is to ensure that my application cannot be run twice, ie. a single instance application.Code:If (UBound(GetProcessesByName(GetCurrentProcess.ProcessName)) > 0) Then MessageBox.Show("Already Running!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End End If
The above code works nicely on XP, but on Vista it produces the following exception:
Any advice on how I can achieve the same effect on Vista too?An unhandled exception of type 'System.InvalidOperationException' occurred in system.dll
Additional information: Couldn't get process information from remote machine.




Reply With Quote