Solved

Process Id

Posted on 2009-05-12
3
181 Views
Last Modified: 2012-05-06
How do I get the process id from inside of the process in C#?
0
Comment
Question by:mdoland
  • 2
3 Comments
 
LVL 6

Expert Comment

by:ViceroyFizzlebottom
ID: 24364886
Process p = Process.GetCurrentProcess();

0
 
LVL 6

Accepted Solution

by:
ViceroyFizzlebottom earned 125 total points
ID: 24364923
Whoops, to answer fully,

int procId = p.Id;
0
 

Author Closing Comment

by:mdoland
ID: 31580537
Perfect, thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 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

16 Experts available now in Live!

Get 1:1 Help Now