看板 C_and_CPP 關於我們 聯絡資訊
遇到的問題: (題意請描述清楚) 利用system("ftp -s:1.txt");每5秒對遠端FTP站台進行資料存取更新動作 可是單純這樣寫每五秒會開啟一個FTP視窗 希望得到的正確結果: 希望在執行的時候不會跳出新視窗 程式跑出來的錯誤結果: 開發平台: (例: VC++ or gcc/g++ or Dev-C++, Windows or Linux) VC++2010 有問題的code: (請善用置底文標色功能) fstream outfile; outfile.open("ftp.txt",ios::binary|ios::out); outfile << "open 站台網址\n 帳號\n 密碼\n get 檔案\n quit\n"; outfile.close(); //timer裡 system("ftp -s:ftp.txt"); -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.130.20.42
Dannvix:試試 ShellExecute()? 07/14 15:17
ljhgc:WinExec("cmd.exe ftp -s:ftp.txt", SW_HIDE); 07/15 13:49
感謝樓上!! 解決困擾我的問題 ※ 編輯: jimmykuo123 來自: 140.130.20.42 (07/15 15:09)