最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
ASP+XML制作菜单管理!
时间:2022-07-02 23:21:51 编辑:袖梨 来源:一聚教程网
YPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.*w**3.org/TR/REC-html40/loose.dtd">
ASP+XML制作菜单管理!
menu.asp 这个是前台执行部分
menu.xml XML数据文件
admin_menu.asp 后台管理XML文件部分
注:由于时间问题,没来得及测试!我^_^#
:shifty:
QUOTE:
'---------------------------------------
'作者:野 草
'日期:2006年4月24日
'Q Q:94440079
'51群:21643964(51JS.COM的群)
'网站: OR
'---------------------------------------
'读取XML文件函数
Function YCMS_menu()
dim menu_temp,m
Set goxml=Server.CreateObject("Microsoft.XMLDOM")
goxml.load(Server.MapPath("menu.xml"))
Set goroot=goxml.documentElement.selectSingleNode("menu")
m=0
For each child in goroot.childNodes
set childmenu=goroot.childnodes.item(m)
Dim menu_open,menu_title,menu_url
menu_open=childmenu.getAttributeNode("open").nodeValue
menu_name=childmenu.getAttributeNode("name").nodeValue
menu_url=goroot.childNodes.item(m).text
'判断是否是弹出窗口
If menu_open=0 Then
'判断是否是第一个,若是第一个则去掉"┊"
If m=0 Then
menu_temp=menu_temp&""
Else
menu_temp=menu_temp&"┊"
End If
Else
If m=0 Then
menu_temp=menu_temp&""
Else
menu_temp=menu_temp&"┊"
End If
End If
set childmenu=nothing
m=m+1
next
set goroot=nothing
set goxml=nothing
YCMS_menu=menu_temp
End Function
'输出XML菜单
response.write(YCMS_menu())
%>
'作者:野 草
'日期:2006年4月24日
'Q Q:94440079
'51群:21643964(51JS.COM的群)
'网站: OR
'---------------------------------------
'读取XML文件函数
Function YCMS_menu()
dim menu_temp,m
Set goxml=Server.CreateObject("Microsoft.XMLDOM")
goxml.load(Server.MapPath("menu.xml"))
Set goroot=goxml.documentElement.selectSingleNode("menu")
m=0
For each child in goroot.childNodes
set childmenu=goroot.childnodes.item(m)
Dim menu_open,menu_title,menu_url
menu_open=childmenu.getAttributeNode("open").nodeValue
menu_name=childmenu.getAttributeNode("name").nodeValue
menu_url=goroot.childNodes.item(m).text
'判断是否是弹出窗口
If menu_open=0 Then
'判断是否是第一个,若是第一个则去掉"┊"
If m=0 Then
menu_temp=menu_temp&""
Else
menu_temp=menu_temp&"┊"
End If
Else
If m=0 Then
menu_temp=menu_temp&""
Else
menu_temp=menu_temp&"┊"
End If
End If
set childmenu=nothing
m=m+1
next
set goroot=nothing
set goxml=nothing
YCMS_menu=menu_temp
End Function
'输出XML菜单
response.write(YCMS_menu())
%>
menu.xml XML数据文件
QUOTE:
admin_menu.asp 后台管理XML文件部分
QUOTE:
'利用ADO.Stream组件保存文件
Function Save(file_body,file_name)
Set OS=Server.CreateObject("ADODB.Stream")
OS.Type=2
OS.Open
OS.Charset="GB2312"
OS.Position=OS.Size
OS.WriteText=file_body
OS.SaveToFile Server.MapPath(file_name),2
OS.Close
Set OS=Nothing
End Function
if Request.QueryString("action")="ok" then
call Save(Request.Form("content"),"menu.xml")
end if
%>
Function Save(file_body,file_name)
Set OS=Server.CreateObject("ADODB.Stream")
OS.Type=2
OS.Open
OS.Charset="GB2312"
OS.Position=OS.Size
OS.WriteText=file_body
OS.SaveToFile Server.MapPath(file_name),2
OS.Close
Set OS=Nothing
End Function
if Request.QueryString("action")="ok" then
call Save(Request.Form("content"),"menu.xml")
end if
%>
注:由于时间问题,没来得及测试!我^_^#
:shifty:
相关文章
- 哔哩哔哩官网主入口-哔哩哔哩官方网站直达链接 12-20
- 微信文件传输助手网页版-官方入口与使用指南 12-20
- 妖精漫画纯净无广免费下拉式入口-妖精漫画免费登录下载入口今日开放 12-20
- 知到智慧树官网网址在哪 知到智慧树网页版快速登录入口 12-20
- 陌陌网页版登录入口-官方陌陌网页版登录官网 12-20
- 夸克网页版入口-一键直达夸克浏览器网页版 12-20