asp.net FCKeditor 2.6.3 配置說明_網頁編輯器

來源:互聯網
上載者:User
它不需要安裝任何形式的用戶端,相容絕大多數主流瀏覽器,支援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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.