首页 新闻 会员 周边 捐助

请教关于使用CDO将Html转换成Mht的问题

0
悬赏园豆:5 [已关闭问题]
public void HtmlToMht(string src, string dst) <br> &nbsp; &nbsp; &nbsp; &nbsp; { <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CDO.Message msg = new CDO.MessageClass(); <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CDO.Configuration c = new CDO.ConfigurationClass(); <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; msg.Configuration = c; <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; msg.CreateMHTMLBody(src, CDO.CdoMHTMLFlags.cdoSuppressNone, "", "");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ADODB.Stream stream = msg.GetStream(); <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stream.SaveToFile(dst, ADODB.SaveOptionsEnum.adSaveCreateOverWrite);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stream.Flush(); <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stream.Close();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br> &nbsp; &nbsp; &nbsp; &nbsp; } <br> 一旦调用这个函数后,这个源文件(src)就没办法删除了,提示文件正在被使用,用File.Delete(src)删除不了,手工删除这个文件也删不了, <br> 甚至连程序退出后这个文件还删不了,一定要把IIS重启或回收一下才可以删除,请教解决方法
DoNet鸟的主页 DoNet鸟 | 初学一级 | 园豆:0
提问于:2008-07-15 09:03
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册