Solved

Get application processID in Visual Studio 2008

Posted on 2009-07-09
6
310 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.
 
0
Comment
Question by:Gknrsy
  • 3
  • 3
6 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 24812574
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
 

Author Comment

by:Gknrsy
ID: 24812593
i tried but not working
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 24812603
Did you get an error ?
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:Gknrsy
ID: 24812615
   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
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 24812642
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
 

Author Comment

by:Gknrsy
ID: 24812657
Thank you very much :)
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question