Solved

Process Id

Posted on 2009-05-12
3
183 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

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…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 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