How to

get process ID

Published: 14. October 2011 | Updated: 26. October 2011
License: Microsoft Public License (MS-PL)
Categories: Windows » Processes
Tags: C# Windows
Was this snippet helpful for you? YESYES / NONO

Import namespace

using System.Diagnostics;

Code

Process process = Process.GetCurrentProcess();
int processId = process.Id;
Send us feedback about this snippet »



Related Snippets: