In my application i want to get the processid simply.
How should i get it?
Thanks in advance
Amritha Chand
Hello,
Hope this code will help you Pass process name in to the below function.It will return the id of the process.
Private Function GetProcessID(ByVal strProcessName As String) As Integer Dim pID As Integer Dim arrProcess As Process() Dim p As System.Diagnostics.Process arrProcess = Process.GetProcessesByName(strProcessName)
p = arrProcess.GetValue(0) pID = p.Id arrProcess = Nothing p = Nothing Return pID End Function
AneeshSalim
Hello,
Hope this code will help you Pass process name in to the below function.It will return the id of the process.
Private Function GetProcessID(ByVal strProcessName As String) As Integer Dim pID As Integer Dim arrProcess As Process() Dim p As System.Diagnostics.Process arrProcess = Process.GetProcessesByName(strProcessName)
p = arrProcess.GetValue(0) pID = p.Id arrProcess = Nothing p = Nothing Return pID End Function