SiteMap  | About    

What is a PID ?

C# Interview Questions and answers

PID is Process ID, to gets the unique identifier for the associated process. Until the process terminates, the process identifier uniquely identifies the process throughout the system.

More about.....C# Running Process List

How to get the current ProcessID ?

For getting a reference to the current process and use System.Diagnostics's Process.Id property:

int nProcessID = Process.GetCurrentProcess().Id; Interview Questions and answers

The PID (process Id) is not valid if the associated process is not running. Therefore, you should ensure that the process is running before attempting to retrieve the Id property

More about.....Start and Kill Processes in C#

Hide console window from Process.Start C# ?

System.Diagnostics.ProcessStartInfo start = new System.Diagnostics.ProcessStartInfo(); start.FileName = dir + @"\yourfile.exe"; start.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;

How can I get the application's path in a .NET console application ?

You can use the following code to get the current application directory.



string path = System.Reflection.Assembly.GetExecutingAssembly().Location; (C) 2017    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.