注册 登录
编程论坛 ASP技术论坛

代码解释?

lxd0980 发布于 2011-05-11 20:27, 464 次点击
这是调用一个editor 的代码:
<%dim rs1  
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from yuzhiguo_products where id="&id,conn,1,1
anclassid=rs1("anclassid")
nclassid=rs1("nclassid")
%>
具体解释下面这一段的作用。
<%
Dim sBasePath
sBasePath = Request.ServerVariables("PATH_INFO")
sBasePath = Left( sBasePath, InStrRev( sBasePath, "/_samples" ) )

Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath    = sBasePath
oFCKeditor.Value    = rs1("jianjie_intro")
oFCKeditor.Create "jianjie_intro"

        %>
6 回复
#2
liang1982072011-05-11 22:29
sBasePath = Request.ServerVariables("PATH_INFO") 获得当前页的虚拟路径(包括文件名)
sBasePath = Left( sBasePath, InStrRev( sBasePath, "/_samples" ) ) 把上面得到的路径中/_samples之前的部分留下。
只能解释这么多 不知道对你有没有帮助。
#3
lxd09802011-05-12 10:22
PATH_INFO 是文件名吧,
#4
dzt00012011-05-12 10:32
当前页的虚拟路径(包括文件名)
#5
yms1232011-05-12 11:23
FCKeditor是一个HTML的文本编辑器
#6
lxd09802011-05-12 11:25
我知道是这是一段调用FCKeditor 的代码?

  Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath    = sBasePath
oFCKeditor.Value    = rs1("jianjie_intro")
oFCKeditor.Create "jianjie_intro"

但不知道这段有什么作用?
#7
yms1232011-05-12 11:35
oFCKeditor.BasePath    = sBasePath'设置编辑器的文件夹
oFCKeditor.Value    = rs1("jianjie_intro")'设置编辑器的值
oFCKeditor.Create "jianjie_intro"'这个方法要看编辑器的说明文档
1