2011-03-16 24 views
0

可能重複:
Related to ProcessStartInfo() method in C#相關的ProcessStartInfo()方法在C#

我想在ProcessStartInfo(F:\\Android\\android-sdk-windows\\platform-tools>adb.exe install F:\\P1\\bin\\ANDPROJ1-debug.apk)通過這些參數 所以我略低於這裏路過這些論點,但我得到一個例外The system cannot find the file specified

PLZ給我的解決方案,爲什麼這個錯誤是未來,而我是正確的檢查所有的路徑。

System.Diagnostics.ProcessStartInfo androidInstallInfo = new System.Diagnostics.ProcessStartInfo(); 
androidInstallInfo.FileName ="adb.exe"; 
androidInstallInfo.Arguments = "install F:\\P1\\bin\\ANDPROJ1-debug.apk"; //"install"+" "+ProjectLocation+"\\" + "bin\\" + ProjectName + "-debug.apk";; 
androidInstallInfo.WorkingDirectory = F:\\Android\\android-sdk-windows\\platform-tools; 
androidInstallInfo.RedirectStandardOutput = true; 
androidInstallInfo.UseShellExecute = false; 
androidInstallInfo.CreateNoWindow = true; 
System.Diagnostics.Process androidProcess = new System.Diagnostics.Process(); 
androidProcess.StartInfo = androidInstallInfo; 
androidProcess.Start(); 
androidProcess.Close(); 
+2

你有沒有注意到的格局嗎?停止發佈重複您現有問題的新問題。如果您需要添加更多信息,請編輯您現有的問題。 – 2011-03-16 07:53:23

回答

0

這也可能是最好設置的完整路徑adb.exe - 大概 -

F:\\Android\\android-sdk-windows\\platform-tools\\adb.exe 
+0

但我想在這個目錄上執行這個adb.exe文件,所以我給文件名=「adb.exe」單獨。 – 2011-03-16 07:57:16

+0

我已經嘗試過你的建議,但現在還沒有工作,並照常發出錯誤。 – 2011-03-16 09:28:36