后台生成HTML时显示中文件方法。解决IE8显示界面的兼容
2009-09-20 22:10
567 查看
1、 注意:要添加 “using System.IO;”FileStream和StreamWriter都是IO的子类
FileStream fs = new FileStream(Server.MapPath(path + "/" + newid + ".html"), FileMode.Create, FileAccess.Write);
StreamWriter sw = new StreamWriter(fs, Encoding.UTF8);
sw.Write(template);
sw.Close();
fs.Close();
2、解决IE8显示界面的兼容
<head id="Head1" runat="server">
<title>添加信息</title>
<meta http-equiv="x-ua-compatible" content="ie=7" />
</head>
FileStream fs = new FileStream(Server.MapPath(path + "/" + newid + ".html"), FileMode.Create, FileAccess.Write);
StreamWriter sw = new StreamWriter(fs, Encoding.UTF8);
sw.Write(template);
sw.Close();
fs.Close();
2、解决IE8显示界面的兼容
<head id="Head1" runat="server">
<title>添加信息</title>
<meta http-equiv="x-ua-compatible" content="ie=7" />
</head>
相关文章推荐
- BCGControlbar生成Ribbon界面在主按钮显示FILE的解决方法。
- Vue.js 中取得后台原生HTML字符串 原样显示问题的解决方法
- [JS]IE兼容模式下会把后台传来的html或者xml标签变成大写的解决方法
- Flash Builder 4.6 无法生成 html 文件的解决方法
- XP中HTM/HTML文件图标无法正常显示的解决方法
- HTML Help Workshop制作帮助文件,图片显示不了的解决方法
- Flash Builder 4.6 无法生成 html 文件的解决方法
- 解决Outlook 2007中收发邮件HTML文件不能显示图片的方法
- 黄聪:wordpress后台,修改数据表前缀之后显示“您没有足够的权限访问这个页面”的解决方法
- android ADT没有生成R.java文件解决方法
- win7 64bit TortoiseSVN文件夹及文件图标不显示解决方法
- onethink后台添加自定义菜单不显示的解决方法(转)
- PHP文件生成的图片无法使用CDN缓存的解决方法
- Win7系统中下载保存文件时不显示桌面选项的解决方法图解
- 解决手机浏览器无法显示本地html文件
- 做机械臂导航遇到的问题1:solidworks在生成urdf文件时崩溃的一种解决方法
- Log4Net 生成多个文件、文件名累加解决方法
- Win7 64位系统打开 chm 文件右侧窗口显示空白的解决方法
- applet在html中无法显示 解决方法
- 关于thinkphp在nginx下上传文件太大显示413错误的解决方法