它不需要安装任何形式的客户端,兼容绝大多数主流浏览器,支持ASP.Net、ASP、ColdFusion 、PHP、Java、Active-FoxPro、Lasso、Perl、ython 等编程环境。

官方网站 http://www.fckeditor.net/

官方文档 http://wiki.fckeditor.net/

下载地址 http://www.fckeditor.net/download/default.html
FCKeditor安装和配置
下载FCKeditor2.63.zip和FCKeditor.NET2.63版的2个zip包
(a) FCKeditor_2.6.3是html文件、Javascript文件和图片等资源文件
(b) FCKeditor.Net_2.6.3.zip是一个ASP.NET控件DLL文件
Asp.Net项目中添加对 FCKeditor 的引用
1. 项目上选择添加引用(Add Reference…),找到 浏览(Browse)标签,然后定位到你解压好的FredCK.FCKeditorV2.dll,确认就可以了
2. 为了方便RAD开发,可以把FCKeditor控件也添加到VS的工具箱(Toolbox)上来,展开工具箱的常用标签组(General),右键选择组件(Choose Items…),在对话框上直接找到浏览按钮,定位FredCK.FCKeditorV2.dll,然后确认就可以了
3. 配置Web.Config,在<appSettings>节点添加,如下所示:

实现代码如下:

<appSettings>
<add key="FCKeditor:BasePath" value="~/Web/fckeditor/"/>
<add key="FCKeditor:UserFilesPath" value="~/Web/Upload/" />
</appSettings>

FCKeditor 的配置:
进入FCKeditor文件夹,编辑 fckconfig.js 文件
1、修改:
实现代码如下:

var _FileBrowserLanguage = ‘php' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = ‘php' ; // asp | aspx | cfm | lasso | php

为:
实现代码如下:

var _FileBrowserLanguage = ‘aspx' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = ‘aspx' ; // asp | aspx | cfm | lasso | php

2、配置语言
修改:
FCKConfig.DefaultLanguage = ‘en' ;
改为:
FCKConfig.DefaultLanguage = ‘zh-cn' ;
3、配置皮肤,有default、office2003、silver风格等,可以使用默认。
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;
4、在编辑器域内可以使用Tab键。(1为是,0为否)
FCKConfig.TabSpaces = 0 ; 改为 FCKConfig.TabSpaces = 1 ;
5、加上几种常用的字体:
FCKConfig.FontNames = ‘宋体;黑体;隶书;楷体_GB2312;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana';
6、编辑器域内默认的显示字体为12px,想要修改可以通过修改样式表来达到要求,打开/editor/css/fck_editorarea.css,修改font-size属性即可
7、关于安全性
如果你的编辑器用在前台非认证的情况下,推荐使用Basic的toolbar
FCKConfig.ToolbarSets["Basic"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','Image','-','About']
] ;
8、在上传文件窗口点击浏览服务器,可能会出现 the server didn't send back a proper xml….. 错误提示,是因为FCKeditor要求不同类型的文件分别传到不同的目录,包括file,image,falsh,media 等目录,可以先建立起来试试。
FCKEditor.NET 2.6 的安全性配置
文件上传,一直是容易被利用的攻击通道,呵呵,所以这里要重点提一下:
打开 editor/filemanager/connectors/aspx/config.ascx
实现代码如下:

private bool CheckAuthentication()
{
//为了防止任意用户均可以打开上传页或者浏览服务器文件
//建议将此处和你的后台管理权限进行集成,如果不需要验证,则直接返回 true 即可
//------------------------------------------------
//1. 假设你用 session 存储用户的登录验证信息,假设 session 的 key 为 auth
// 则需要返回
//return (Session["auth"] != null && Session["auth"] == "验证值");
//2. 如果你用 FORM 验证方式,则可以验证
//return Page.User.Identity.IsAuthenticated;
// WARNING : DO NOT simply return "true". By doing so, you are allowing
// "anyone" to upload and list the files in your server. You must implement
// some kind of session validation here. Even something very simple as...
//
//return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
//
// ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
// user logs in your system.
return true;
}

我对上面的部分进行汉化和使用的说明s

以上就是【asp.net FCKeditor 2.6.3 配置说明】的全部内容了,欢迎留言评论进行交流!

赞(0) 踩(0)
发表我的评论

最新评论

  1. 暂无评论