Launching C# application from asp.net

bhatti81

Newcomer
Joined
Jul 25, 2003
Messages
19
Two important things i need to ask.

1. What piece of code will be required to launch an application from our asp.net code. The application is a .NEt application written in c# installed in the system(in program files). So what code will be required to launch that application.

2. When i will launch the application from my asp.net code, at that time i want to pass a string argument to my application. So how will i pass arguemnt while launching the application.

Hayee
 
To start an application you System.Diagnostics.Process class. Like this:
Visual Basic:
System.Diagnostics.Process.Start("Path to executable")
To get some other options for starting the process use the ProcessStartInfo class:
Visual Basic:
Dim pinfo As New System.Diagnostics.ProcessStartInfo
pinfo.Arguments = "arguments go here"
pinfo.FileName = "path to executable"
System.Diagnostics.Process.Start(pinfo) 
'start using the info provided in the pinfo object
 
Back
Top