[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 336
  • Last Modified:

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.
 
0
Gknrsy
Asked:
Gknrsy
  • 3
  • 3
1 Solution
 
DhaestCommented:
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;
0
 
GknrsyAuthor Commented:
i tried but not working
0
 
DhaestCommented:
Did you get an error ?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
GknrsyAuthor 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
0
 
DhaestCommented:
2 Solutions :)

1. Dim abc As System.Diagnostics.Process = System.Diagnostics.Process.GetProcessesByName("iexplore")(0)
   MsgBox(abc.Id)

2. Dim abc As Integer = System.Diagnostics.Process.GetProcessesByName("iexplore")(0).Id
0
 
GknrsyAuthor Commented:
Thank you very much :)
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now