bool SaveWholePage(const wchar_t *wzUrl,const wchar_t *wzFileName)
{
CoInitialize();
IMessagePtr iMsg(__uuidof(Message));
try
{
iMsg->CreateMHTMLBody(BSTR(wzUrl),cdoSuppressNone,BSTR(L"domain\\username"),BSTR(L"password"));
}
catch(_com_error err)
{
const wchar_t *wzError = err.Description();
OutputDebugStringW(wzError);
return false;
}
_StreamPtr pStream;
pStream.CreateInstance(__uuidof(Stream));
iMsg->GetStream(&pStream);
pStream->SaveToFile(wzFileName,adSaveCreateOverWrite);
CoUninitialize();
return true;
}
根据url保存到本地mht格式
最新推荐文章于 2021-08-26 15:23:10 发布