System.Diagnostics.Process

System.Diagnostics.Process

System.Diagnostics.Process 

The Process class provides functionality to monitor system processes across the network, and to start and stop local system processes.

In additional to retrieving lists of running processes (by specifying either the computer, the process name, or the process id) or viewing information about the process that currently has access to the processor, you can get detailed knowledge of process threads and modules both through the Process class itself, and by interacting with the ProcessThread and ProcessModule classes.

The ProcessStartInfo class enables you to specify a variety of elements with which to start a new process, such as input, output, and error streams, working directories, and command line verbs and arguments. These give you fine control over the behavior of your processes.

sample code:

How to list all the running process:

foreach(System.Diagnostics.Process opro in System.Diagnostics.Process.GetProcesses())

{

MessageBox.Show(opro.ToString());

}

How to start a new process:

System.Diagnostics.ProcessStartInfo oInfo =new ProcessStartInfo(http://developers.chrisranjana.com);

oInfo.CreateNoWindow=true;

System.Diagnostics.Process.Start(oInfo);

 

 

 

 

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.