用CHttpFile实现http文件断点续传出现的问题
第二次 请求的代码如下:
CHttpConnection* myHTTP=m_InternetSession.GetHttpConnection("www.mytest.com");
CHttpFile* myHttpFile=myHTTP->OpenRequest(CHttpConnection::HTTP_VERB_GET, "install.exe", NULL, 1, NULL, NULL, HSR_DOWNLOAD | INTERNET_FLAG_EXISTING_CONNECT |INTERNET_FLAG_NO_AUTO_REDIRECT);
myHttpFile->SendRequest();
myHttpFile->Seek(4096000, CFile::begin); //进行文件指针定位
while (nRead == BUF_SIZE)
{
nRead = myHttpFile->Read(buffer, BUF_SIZE); }
}
使用Seek好象没有效果
如何在请求中增加参数: "Range: bytes=xxxxx-", //xxxx为起始字节,按需要而定