Link to home
Start Free TrialLog in
Avatar of Gknrsy
Gknrsy

asked on

Get application processID in Visual Studio 2008

I need to get processid from process name.

ex: runing blabla.exe , i want to get PID blabla.exe and write to textbox.
 
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Can you check if this gives what you want
c#-code: System.Diagnostics.Process.GetProcessesByName("process name")[0].Id;System.Diagnostics.Process.GetProcessesByName("process name")[0].Id;
Avatar of Gknrsy
Gknrsy

ASKER

i tried but not working
Did you get an error ?
Avatar of Gknrsy

ASKER

   If Process.GetProcessesByName("iexplore").Length > 0 Then
            Dim abc As System.Diagnostics.Process = System.Diagnostics.Process.GetProcessesByName("iexplore")[0].Id
            MsgBox(abc.Id)

error: identifier expected
          abc not declared
ASKER CERTIFIED SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gknrsy

ASKER

Thank you very much :)