18,356
社区成员
发帖
与我相关
我的任务
分享
DWORD byteread=0;
char buffer[65535];
memset(buffer,0,sizeof(buffer));
HINTERNET internetopen;
internetopen=InternetOpen(L"Testing",INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0);
if (internetopen==NULL)
{
return FALSE;
}
HINTERNET internetopenurl;
CString strURLPath = L"http://www.xatuxun.com//update//Resource//BKGround//elthumbs.db";
internetopenurl=InternetOpenUrl(internetopen, strURLPath, NULL,0,INTERNET_FLAG_RELOAD,0);
if (internetopenurl==NULL)
{
goto there;
}
//计算文件总大小
DWORD dwByteToRead = 0;
DWORD dwSizeOfRq = 4;
if (!HttpQueryInfo(internetopenurl, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, (LPVOID)&dwByteToRead, &dwSizeOfRq, NULL))// ---------------- 这里得到的文件大小不对(1090560字节)。
{
return FALSE;
}