Monday, March 29, 2004

Start and Stop local system processes:

The System.Diagnostics.Process class can be used to start and stop system processes. A process means a running application. The Process class is useful for starting, stopping, controlling, and monitoring applications. By using this class, you can obtain a list of the processes that are running or start a new process.

Namespace: System.Diagnostics

The following example reveals how to start Internet Explorer as a process from within your application.

'Declare and instantiate a new process component.
Dim proc As System.Diagnostics.Process

proc = New System.Diagnostics.Process()


'Do not receive an event when the process exits.

proc.EnableRaisingEvents = False

'Start Internet Explorer, passing in a web page.

proc.Start("IExplore.exe", "http://www.arunmicrosystems.netfirms.com")

For more info and examples have a look at the following links.

1. http://www.dotnet247.com/247reference/System/Diagnostics/Process.aspx

2. http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemDiagnosticsProcessClassTopic.asp

No comments: