[问题] cURL找资料夹下档案个数

楼主: jiqian (JIM)   2015-07-13 23:06:09
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):

Links booklink

Contact Us: admin [ a t ] ucptt.com