This code verifies how many instances of a given process name is running on the machine.
ByVal pstrProcessName as String
True if there is another instance or False is there isn't
none that I now
Submitted On | |
By | George F Richardson |
Level | Beginner |
User Rating | 4.0 (8 globes from 2 users) |
Compatibility | VB.NET |
Category | Algorithims |
World | .Net (C#, VB.net) |
Archive File |
Imports System
Imports System.Diagnostics
Imports System.ComponentModel
Public Clas TestClas 'It's wrong because pscode.com doesn't accept the word Clas (with 2 s).
Public Function prevInstance(ByVal pstrProcessName as string) As Boolean
Dim lblnRet As Boolean = False
Dim lintInst As Integer
lintInst = UBound(Diagnostics.Process.GetProcessesByName(pstrProcessName))
If lintInst > 0 Then
lblnRet = True
End If
Return lblnRet
End Function
End Clas