我有一個Web應用程序,我想執行一個.exe文件。ProcessStartInfo WorkigDirectory參數
ProcessStartInfo info = new ProcessStartInfo();
info.WorkingDirectory = this.WorkingDirectory;
,當我把我的
info.WorkingDirecoty = Request.MapPath("~");
info.FileName = Server.MapPath("~/theFile.exe");
它的工作原理。但是當我把他們這樣的:
info.WorkingDirecoty = "~";
info.FileName = "~/theFile.exe";
它不工作,爲什麼?我該如何解決這個問題?或者我應該總是使用Server.MapPath?
最後兩個代碼段的區別在哪裏? – PVitt
爲什麼你不想使用Server.MapPath? –
@PVitt:輸入錯誤。我編輯了他們 – Grace