Click here to Skip to main content
15,947,958 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have windows mobile application, i want to get by C# code its Process ID (PID) while its running ..
so any one know function that return PID ?

Use the static GetCurrentProcess() method on the Process class:
int nProcessID = Process.GetCurrentProcess().Id;
Share this answer

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900