.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> System Process >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Getting Information of Current Running Process

Posted By:Hefin Dsouza       Posted Date: April 29, 2009    Points: 10    Category: System Process    URL: http://www.dotnetspark.com  
 

There may me a need for you to get information of the Current Running Process.The Code Below will allow you to display Information about the Current Process.


public void GetCurrentProcessesDetails()
{
      Process currentProcess = Process.GetCurrentProcess();
      Console.WriteLine("Current Process is:- " +currentProcess.ProcessName);
      Console.WriteLine(
"Current Process ID is:- " + currentProcess.Id);
      Console.WriteLine(
"Total Process Time:- " + currentProcess.TotalProcessorTime);
}

Regards Hefin Dsouza
[Software Freelancer and Trainner]

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend