2010-06-28 74 views
0

我想打電話給第三方軟件在.NET應用程序(C#) 的代碼如下:的win32系統未處理的異常

Process proc = new Process(); 
proc.EnableRaisingEvents = false; 
\\name of the file 
proc.StartInfo.FileName = "filename"; 
\\Path where the file is located 
proc.StartInfo.Arguments = "filepath"; 

proc.Start(); 

但它拋出一個異常的Win32系統未處理的異常

請幫助

回答

0

你應該真的發佈實際的錯誤信息以及實際的路徑,以使它更容易,但似乎你可能會使用錯誤的參數。 相反,設置文件路徑,你應該通過它的文件名之前,所以以下可能的工作參數:

Process proc = new Process(); 
proc.EnableRaisingEvents = false; 
proc.StartInfo.FileName = System.IO.Path.Combine("filepath", "filename"); 
proc.Start(); 

你可以找到更多信息,包括樣本,在MSDN頁Process.Starthere

+0

非常感謝... :)它的工作 – user362130 2010-06-28 09:55:57