We help IT Professionals succeed at work.

Get application processID in Visual Studio 2008

Medium Priority
362 Views
Last Modified: 2013-11-27
I need to get processid from process name.

ex: runing blabla.exe , i want to get PID blabla.exe and write to textbox.
 
Comment
Watch Question

Dirk HaestProject manager
CERTIFIED EXPERT

Commented:
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;

Author

Commented:
i tried but not working
Dirk HaestProject manager
CERTIFIED EXPERT

Commented:
Did you get an error ?

Author

Commented:
   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
Project manager
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thank you very much :)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.