Keep in touch

you can keep in touch with my all blogs and sites by install this Toolbar...
http://rworldtoolbar.ourtoolbar.com/

Tuesday, July 1, 2008

Check Existing Duplicate Process

Imports System.Threading
Module Module1
Sub Main()
Dim MatchingNames As System.Diagnostics.Process()
Dim TargetName As String

TargetName = System.Diagnostics.Process.GetCurrentProcess.ProcessName
MatchingNames = System.Diagnostics.Process.GetProcessesByName(TargetName)

If (MatchingNames.Length = 1) Then
Console.WriteLine("Started...")
Else
Console.WriteLine("Process already running")
End If
End Sub
End Module

No comments: