Get a reference to the current process and use System.Diagnostics
‘s Process.Id
property:
int nProcessID = Process.GetCurrentProcess().Id;
More Related Contents:
- Correct way (in .NET) to switch the focus to another application
- Is there a memory limit for a single .NET process
- Find all child processes of my own .NET process / find out if a given process is a child of my own?
- How to start a 64-bit process from a 32-bit process
- How to check if a program is using .NET?
- List AppDomains in Process
- How do I attach Visual Studio to a process that is not started yet?
- Visual Basic Capture output of cmd
- How do I determine the owner of a process in C#?
- Reference variables and objects elsewhere in a form
- How to automatically select all text on focus in WPF TextBox?
- ApartmentState for dummies
- Why don’t structs support inheritance?
- What are the advantages and disadvantages of using the GAC?
- Create virtual directory on same azure web app
- WCF: Exposing readonly DataMember properties without set?
- Any way to make DataContractJsonSerializer serialize Dictionaries properly?
- == vs. Object.Equals(object) in .NET
- How to Convert LINQ Comprehension Query Syntax to Method Syntax using Lambda
- WCF service startup error “This collection already contains an address with scheme http”
- Redirect Trace output to Console
- Memory leaks in .NET [closed]
- How to make a Windows Forms .NET application display as tray icon?
- What should be the lifetime of an NHibernate session?
- Change selected and unfocused Listbox style to not be grayed out
- Detecting what the target object is when NullReferenceException is thrown
- What’s the different between ASP.NET AJAX pageLoad() and JavaScript window.onload?
- Default ContextMenu Style – WPF
- Can we get the UAC prompt to show only once?
- .net: How to parse a date with this format: 08 Feb 2011 06:46