2015-04-01 30 views
-5

我做了一個c程序,其中使用了非常臭名昭着的system()函數來打開Internet Explorer.There沒有錯誤,因爲我編譯它但它給我輸出非法命令。問題是什麼??我已經在c盤重新檢查了我的Internet Explorer地址,但一切都很完美。如何解決這個問題?使用c編程語言打開Internet Explorer

+1

***顯示代碼*** – abelenky 2015-04-01 16:56:24

+0

您是否檢查了權限? – Deanie 2015-04-01 17:01:20

回答

2

我猜你所指定的路徑到Internet Explorer這樣

"C:\Program Files\Internet Explorer\iexplore.exe" 

但由於\字符是一個「逃」字在一個字符串,你需要打敗逃生

"C:\\Program Files\\Internet Explorer\\iexplore.exe" 

編譯時沒有錯誤,因爲編譯器無法檢查傳遞給system()的命令是否有意義,或者在運行時是否有效。