A subscrie la spre Cum- La spre Geek

Important! This is an automatic machine translated page. If you can read english, you should Click Here to read the original English version of the article.

A lua un Listă de Running Proces înăuntru C#

Art.hot. System.Diagnostics namespace contact funcție that allow tu la spre conducere proces, trei, eventlogs și performance informații.

Art.hot. System.Diagnostics.Process object a da tu accent la spre functionality enabling tu la spre conducere sistem proces. Noi voință a voi folos this object la spre a lua un listă de running proces.

A aduna this linie la spre al tău folosire listă:

folosire System.Diagnostics;

Acum tu poți a lua un listă de la proces cu art.hot. Process.GetProcesses() method, as seen înăuntru this example:

Proces[] processlist = Process.GetProcesses();

foreachProcess( theprocess înăuntru processlist){
Console.WriteLine(”Process: {0} Identitate: {1}”, theprocess.ProcessName, theprocess.Id);
}

Niște interesant properties de la Proces object:

p.StartTime (manifestare art.hot. timp art.hot. proces scrobeală)
p.TotalProcessorTime (manifestare art.hot. amount de CPU timp art.hot. proces has a lua)
p.Threads ( a da accent la culegere de trei în proces)

Art.hot. .NET framework într-adevăr a face things simplu!

This anghinară was originally part. trecut de la vb. write on 11/23/06 Tagged cu: Programming