2014年9月3日 星期三

C#執行EXE檔加參數

C#執行EXE檔加參數
string text = "";
string strUser = "894128";
string strPath = HttpContext.Current.Server.MapPath("~/OfficeUpload/");
System.IO.File.WriteAllText(strPath + strUser + ".txt", text);
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = Path.GetFileName(strPath + "/StockMergeRpt.exe");
psi.WorkingDirectory = Path.GetDirectoryName(strPath + "/StockMergeRpt.exe");
psi.Arguments = "-i " + strUser + ".txt -o " + strUser + ".doc";
Process.Start(psi);

沒有留言:

張貼留言