Monday, December 05, 2005
How to call External Application through ASP.NET
string file = Server.MapPath(@"MyApp.exe");
ProcessStartInfo info = new ProcessStartInfo(file, "otherargs");
info.RedirectStandardOutput = true;
info.UseShellExecute = false;
Process p = Process.Start(info);
p.Start();
// Send whatever was returned through the output to the client.
Response.Write(p.StandardOutput.ReadToEnd());
ProcessStartInfo info = new ProcessStartInfo(file, "otherargs");
info.RedirectStandardOutput = true;
info.UseShellExecute = false;
Process p = Process.Start(info);
p.Start();
// Send whatever was returned through the output to the client.
Response.Write(p.StandardOutput.ReadToEnd());