当前位置: 首页 > 图文教程 > 网络编程 > ASP > 如何使用fckeditor在线编辑器

ASP
ASP汉字转拼音,支持自定义特殊词语
终于找到了ASP下标越界的解决方法
ASP实现长文章手动分页的代码
如何节约程序开发中的时间
防sql注入代码
asp连接远程mssql数据库代码
fso检测文件、磁盘、文件夹是否存在代码
asp随机获取数据库中的记录代码
利用fso显示某一文件夹中的所有内容
利用asp获取客户端真实的IP地址
Cookies常用命令简介
将多行区域表单中的内容换成html代码
rs.open sql,conn,1,1中各参数的意义
动态图形验证码
常用的asp代码
ASP如何得到字符串的每一位字符
ASP用户登录代码
网站静态页面生成方法
fso生成有多行内容的html文件
fso向html文件追加内容

ASP 中的 如何使用fckeditor在线编辑器


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-14   浏览: 49 ::
收藏到网摘: n/a

1、去http://www.aspprogram.cn/soft.asp?id=38这个地址下载fckeditor在线编辑器(请先杀毒,后使用)
2、fckeditor配置
 a、为了使用根目录,我们将IIS的默认网站设置为站点,指向fckeditor(这个可改名)所在的目录。
 b、现在建立一个asp文件,来调用fckeditor在线编辑器,假设为news.asp,代码如下:

<!--#include file="FCKeditor/fckeditor.asp" -->
<%
a=request("a")
If a="" Then 
%>
  <table border=1 cellpadding=0 cellspacing=0>
  <form name="form1" method="post" action="?a=save">
  <tr>
  <td align="right">新闻内容</td>
  <td height="25" align="left">
<%  
  Dim oFCKeditor 
  Set oFCKeditor = New FCKeditor 
  oFCKeditor.BasePath = "/fckeditor/"  
   '设置编辑器的路径,我站点根目录下的一个目录 
   '如果你改了目录的名,这里就需要改成那个目录名
  oFCKeditor.ToolbarSet = "Default" 
  oFCKeditor.Width = "700" 
  oFCKeditor.Height = "500" 
  oFCKeditor.Value = "" 
  '这个是给编辑器初始值 
  oFCKeditor.Create "logbody" 
  '以后编辑器里的内容都是由这个logbody取得,命名由你定 
 %></td>
</tr>
<tr>
 <td colspan=2 align="center">
 <input type="submit" value=" 提 交 ">
 </td>
</tr>
</form>
</table>
<%
Else '显示fckeditor在线编辑器内容
 response.write request("logbody")
End If
%>
到这里,可以上传文字了

3、这个时候,我们在上传图片,出现上传错误。解决方法:

(1)fckconfig.js 中修改
 FCKConfig.DefaultLanguage   = 'zh-cn' ;    //原来是en
 FCKConfig.TabSpaces   = 1 ; //在编辑器中是否可以是否TAB键 0 不可用 1 为可用
 var _FileBrowserLanguage = 'asp' ; 
 var _QuickUploadLanguage = 'asp' ; 
(2) fckeditor.asp 中修改
  sBasePath   = "/fckeditor/" 
  '表示 当前这个文件 fckeditor.asp相对于站点根目录的路径,看看我的目录排放

(3) FCKeditor\editor\filemanager\connectors\asp\config.asp中修改这里设置,用于文件上传
 ConfigIsEnabled = true '启用上传功能 把 false 改成 true
 ConfigUserFilesPath = "/upFile/" '设置你的上传目录 这里 "/upFile/" 表示站点根目录下的 upFile目录 ,这个目录是需要自己创建的,大家可以看到上图目录结构中我创建了 upFile 目录 ,这样上传的文件将会存放到这个目录中。FckEditor会根据您上传的类别自动在upFIle目录中创建如 image 、 flash 等目录。

这样就可以了,我们来试试index.asp程序,成功,可以上传图片了!!!
(4) fckeditor\editor\filemanager\browser\default\connectors\asp\config.asp 中修改
这里设置,用于浏览服务器上文件
ConfigIsEnabled = true '启用浏览功能,把false改成true
ConfigUserFilesPath = "/upfile/" 同(3)

完毕。