首先添加com引用CDO for windows 2000 library,然后下面的函数就可以完成下载的功能:
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--> static void downloadMht( string url, string path)
{
CDO.Message msg = new CDO.Message();
CDO.Configuration cfg = new CDO.Configuration();
msg.Configuration = cfg;
msg.CreateMHTMLBody(url, CDO.CdoMHTMLFlags.cdoSuppressAll, "" , "" );
msg.GetStream().SaveToFile(path, ADODB.SaveOptionsEnum.adSaveCreateOverWrite);
}
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--> static void downloadMht( string url, string path)
{
CDO.Message msg = new CDO.Message();
CDO.Configuration cfg = new CDO.Configuration();
msg.Configuration = cfg;
msg.CreateMHTMLBody(url, CDO.CdoMHTMLFlags.cdoSuppressAll, "" , "" );
msg.GetStream().SaveToFile(path, ADODB.SaveOptionsEnum.adSaveCreateOverWrite);
}