htm格式转换成mht
来源:互联网 发布:武汉理工大学网络大专 编辑:程序博客网 时间:2024/05/21 18:35
private void ProduceMhtFile(string URL,string FileName) {
CDO.Message msg=new CDO.MessageClass();
msg.CreateMHTMLBody(URL,CDO.CdoMHTMLFlags.cdoSuppressAll,"","");
ADODB.Stream sw=msg.GetStream();
string urlPath = HttpContext.Current.Request.ApplicationPath + "/Temp/";
//虚拟目录
string physicPath = HttpContext.Current.Server.MapPath(urlPath);
//物理地址
string strFileName=Guid.NewGuid()+".mht";
sw.SaveToFile(physicPath+strFileName,ADODB.SaveOptionsEnum.adSaveCreateOverWrite);
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "mht";
HttpContext.Current.Response.WriteFile(urlPath+strFileName);
HttpContext.Current.Response.AppendHeader("Content-Disposition","attachment;filename="+HttpUtility.UrlEncode(FileName)+"");
HttpContext.Current.Response.Charset ="GB2312";
HttpContext.Current.Response.ContentEncoding =System.Text.Encoding.GetEncoding("GB2312");
HttpContext.Current.Response.ContentType ="text/mhtml";
//image/JPEG;text/HTML;image/GIF;vnd.ms-excel/msword
HttpContext.Current.Response.Flush();
System.IO.File.Delete(physicPath+strFileName);
//删除临时文件
HttpContext.Current.Response.End();
}
- htm格式转换成mht
- 支持htm,html转换成mht
- office格式转换成mht
- php解析mht文件转换成html
- 有关“.mht”格式
- 把htm文件编译为chm格式,htm转换为一张jpg图,htm转换为pdf
- java通过jacob来读取word转换为htm格式
- vb6 转换mht到 doc
- JSP 转换 mht java 代码
- HTML格式转成MHT格式的组件
- HTML格式转成MHT格式的组件
- 谁能真正的实现将htm另存为mht文件
- Batchwork.Batch.HTM.To.MHT.Converter.2012.4.1102.1985.Cracked-ROF
- 将asp页面转换成htm页面
- jsp页面转换成htm页面
- 将asp页面转换成htm页面
- 将asp页面转换成htm页面
- webarchive文件转换成htm文件
- php使用iconv函数注意事项
- Silverlight主题
- 数据库的增删改查用单元测试AndroidTestCase
- 黑马程序员--java基础FileInputStream
- HDU 1063 - Exponentiation
- htm格式转换成mht
- 我很纠结
- CString::GetLength()总是返回0
- android学习笔记19--------------Spinner 下拉列表的用法
- WinCE 自动运行自定义程序
- Struts2 整合 Spring 应用实例
- 读书笔记2:策略模式
- getLaunchIntentForPackage 获取到的为null原因
- flume配置文件