Asp classic 从asp页执行exe
我有一个执行pdf处理的exe文件。我想在asp页面中调用此exe,并希望asp页面等待exe完成处理。有解决办法吗 谢谢 -维韦克Asp classic 从asp页执行exe,asp-classic,Asp Classic,我有一个执行pdf处理的exe文件。我想在asp页面中调用此exe,并希望asp页面等待exe完成处理。有解决办法吗 谢谢 -维韦克 Set WshShell = WScript.CreateObject("WScript.Shell") intReturn = WshShell.Run(Server.MapPath("PathToMyApp.exe"), 1, TRUE) public ActionResult RunReport() { //Set
Set WshShell = WScript.CreateObject("WScript.Shell")
intReturn = WshShell.Run(Server.MapPath("PathToMyApp.exe"), 1, TRUE)
public ActionResult RunReport()
{
//Set this page timeout
HttpContext.Server.ScriptTimeout = int.MaxValue;
var psi = new ProcessStartInfo()
{
//Arguments = string.Format("/k \"\"Test.exe\" \"{0}\" \"{1}\" \"{2}\"\"", arg1, arg2, arg3),
CreateNoWindow = false,
UseShellExecute = true,
WorkingDirectory = @"C:\Test",
FileName = "Test.exe"
};
using (var process = Process.Start(psi))
{
process.WaitForExit(int.MaxValue);
}
return RedirectToAction("Index");
}