[問題] cURL找資料夾下檔案個數

看板C_and_CPP (C/C++)作者 (JIM)時間10年前 (2015/07/13 23:06), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
G開發平台(Platform): (Ex: VC++, GCC, Linux, ...) VC10 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) CURL1.43 問題(Question): 我在http://192.168.100.1/icon/下有多個不斷增加的xx%d.bmp(檔名有數字規律) 現在是以check connect的方式去一個一個做找到最後一個 請問有什麼比較有效率的方法嗎? 有辦法可以知道檔案數量或其他方式嗎~謝謝! 餵入的資料(Input): 預期的正確結果(Expected Output): 錯誤結果(Wrong Output): 程式碼(Code):(請善用置底文網頁, 記得排版) bool checkurl(char* url) { CURL* handle = curl_easy_init(); if(NULL != handle && NULL != url) { curl_easy_setopt(handle,CURLOPT_URL,url); curl_easy_setopt(handle,CURLOPT_CONNECTTIMEOUT,5); curl_easy_setopt(handle,CURLOPT_HEADER,true); curl_easy_setopt(handle,CURLOPT_NOBODY,true); curl_easy_setopt(handle,CURLOPT_MAXREDIRS,0); curl_easy_setopt(handle,CURLOPT_WRITEFUNCTION,&processdata); curl_easy_perform(handle); int retcode = 0; curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE , &retcode); bool res = false; if(200 == retcode) { res = true; } curl_easy_cleanup(handle); return res; } else{ return false; } } 補充說明(Supplement): -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.123.112.56 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1436799977.A.BC5.html
文章代碼(AID): #1LezFfl5 (C_and_CPP)
文章代碼(AID): #1LezFfl5 (C_and_CPP)