[問題] c++ 2008 以buton 開啟.exe

看板C_and_CPP (C/C++)作者時間16年前 (2010/05/15 18:41), 編輯推噓3(304)
留言7則, 4人參與, 最新討論串1/1
各位好^^,我目前使用Visual C++ 2008 express 要以button 開啟電腦中的某一軟體 程式碼如下,我是將其寫在button中 private: System::Void button5_Click (System::Object^ sender, System::EventArgs^ e) {System("C:\Program Files\POV-Ray for Windows v3.6\bin\pvengine.exe");} 但是就是無法開啟@@ 檔案路徑是用絕對路徑,有看到說絕對路徑 C: 後要用兩個反斜線 -> C:\\ ?! 但也都try了,還是不行呀! 到底是哪邊出了錯呢? 請各位指點一下,謝謝! 偵錯結果如下 1>------ 已開始建置: 專案: 碰撞程式介面, 組態: Debug Win32 ------ 1>正在編譯... 1>碰撞程式介面.cpp 1>c:\Form1.h(182) : error C2882: 'System' : 運算式中命名空間識別項的不合法使用 1>已將建置記錄儲存於 "file://c:\Documents and Settings\seven\My Documents\Visual Studio 2008\Projects\碰撞程式介面\碰撞程式介面\Debug\BuildLog.htm" 1>碰撞程式介面 - 1 個錯誤,0 個警告 ========== 建置: 0 成功、1 失敗、0 最新、0 略過 ========== ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.199.205 ※ 編輯: gyseven 來自: 140.113.199.205 (05/15 18:48) ※ 編輯: gyseven 來自: 140.113.199.205 (05/15 18:54) ※ 編輯: gyseven 來自: 140.113.199.205 (05/15 19:05) ※ 編輯: gyseven 來自: 140.113.199.205 (05/15 19:06)

05/15 19:19, , 1F
因為 system 寫成 System ?
05/15 19:19, 1F

05/15 19:34, , 2F
我的話會用System.Diagnostics.Process去開XD
05/15 19:34, 2F

05/15 19:46, , 3F
喔喔 對 都沒想到 XD
05/15 19:46, 3F

05/15 19:56, , 4F
確定是寫System,用System.Diagnostics.Process還是不行@@
05/15 19:56, 4F

05/15 22:24, , 5F
你要那樣用就要寫小寫的system...
05/15 22:24, 5F

05/17 14:24, , 6F
System::Diagnostics::Process::Start("c:\\OOXX.exe");
05/17 14:24, 6F

05/17 14:24, , 7F
這個呢?
05/17 14:24, 7F
文章代碼(AID): #1Bxdf6cP (C_and_CPP)
文章代碼(AID): #1Bxdf6cP (C_and_CPP)