0

如何在不将此页面保存到 C++中的磁盘的情况下将网页下载到字符串中?

URLDownloadToFile MSDN 函数仅将页面保存到磁盘。

4

1 回答 1

2

您是否查找过其中URLXXX提到的其他功能?怎么样:URLOpenBlockingStream

//implement filestream that derives from IStream
class StringStream : public IStream
{
  StringStream(std::wstring buf) 
    {
        _refcount = 1;
        _mBuf = buf;
    }

    ~ StringStream ()
    {

    }
   // implement IUknown, IStream interfaces
   private:
    std::wstring _mBuf;
    long _refcount;
 };

在此处查看基于默认文件的 IStream 实现。

于 2009-10-12T20:32:14.423 回答