为什么char *strRange="Range:bytes=16527360-\r\n";
      DWORD dwHeaderLength=strlen(strRange);
      HttpSendRequest(m_Request,strRange,dwHeaderLength,NULL,0))
这样写,用InternetReadFile读文件,还是从最开始那里读,没有跳到我要的那个位置,请问高手应该怎么解决?

解决方案 »

  1.   

    你需要先调整WEB上的文件指针。而且WEB服务器也必须支持随机读取文件的操作,这样你才可以实现断点续传,参考:
    http://blog.csdn.net/yuguanglou/archive/2004/11/10/176061.aspx
      

  2.   

    InternetSetFilePointer
    Sets a file position for InternetReadFile. This is a synchronous call; however, subsequent calls to InternetReadFile might block or return pending if the data is not available from the cache and the server does not support random access
      

  3.   

    InternetSetFilePointer在异步方式是不行的,根本没法准确的跳到具体位置,已经确定服务器是支持
    随机读取文件的操作,用HttpSendRequest发range的命令的方法应该是可行的,可是好像命令发过去服务器都没接受,返回的还是从初始位置开始,会不会是格式还是参数设错了,请高手指点,很希望可以快点解决这个问题,分数不够可以再加!!!!