CuteEditor在线html编辑器
CuteEditor.cn有破解版下载
public bool WriteFile(string strContent)
{
string path = HttpContext.Current.Server.MapPath("~/JiChuXinXi/");
Encoding code = Encoding.GetEncoding("gb2312");
// 读取模板文件
string temp = HttpContext.Current.Server.MapPath("~/JiChuXinXi/jianjie.htm");
StreamReader sr = null;
StreamWriter sw = null;
string str = "";
try
{
sr = new StreamReader(temp, code);
str = sr.ReadToEnd(); // 读取文件
str = str.Replace("content", strContent); //替换模板里的标记
// 写文件
string htmlfilename = "queryjianjie.htm";
sw = new StreamWriter(path + htmlfilename, false, code);
sw.Write(str);
sw.Flush();
return true;
}
catch (Exception exp)
{
HttpContext.Current.Response.Write(exp.Message);
HttpContext.Current.Response.End();
return false;
}
finally
{
sr.Close();
sw.Close();
}
1. 页面注册
<%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>
2. 常用配置
上传文件配置:..\CuteEditor\Configuration\Security\Default.config
如:
<security name="MaxImageFolderSize">102400</security>
设定用于保存上传图片的文件夹容量
编辑器配置:..\CuteEditor\Configuration\Shared\Common.config
如:
<FontName>
<item text="Simsun" html="<font size=3 face='Simsun'>宋体</font>">Simsun</item>
<item text="SimHei" html="<font size=3 face='SimHei'>黑体</font>">SimHei</item>
</FontName>
添加中文字体选择

浙公网安备 33010602011771号