Solved

Get application processID in Visual Studio 2008

Posted on 2009-07-09
6
298 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
Comment Utility
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
Comment Utility
i tried but not working
0
 
LVL 53

Expert Comment

by:Dhaest
Comment Utility
Did you get an error ?
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:Gknrsy
Comment Utility
   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
Comment Utility
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
Comment Utility
Thank you very much :)
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
asp.net mvc5 3 35
String manipulation 15 48
Unable  to create new object 9 16
Different Delete Messages 7 4
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

763 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now