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="&lt;font size=3 face='Simsun'&gt;宋体&lt;/font&gt;">Simsun</item>
    
<item text="SimHei" html="&lt;font size=3 face='SimHei'&gt;黑体&lt;/font&gt;">SimHei</item>
</FontName>

添加中文字体选择

 

 

 

posted @ 2010-05-12 11:59  城市里的鱼  阅读(313)  评论(0)    收藏  举报