命名空間:
using System.Diagnostics;
邏輯代碼:
//程序
string str = Server.MapPath("~/Exes/HtmlToPdf.exe");
//參數(注:pageUrl表示訪問地址,_pdfHQTemplatePath表示文件路徑)
var arguments = " \"" + pageUrl + "\" " + _pdfHQTemplatePath;
Process p = Process.Start(str, arguments);
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.WaitForExit();//等待進程關閉或退出後執行以下步驟
.
.
.
.