asp xml制作菜单管理系统_ASP+XML制作菜单管理!

更新时间:2014-10-01    来源:系统相关    手机版     字体:

【www.bbyears.com--系统相关】

ASP+XML制作菜单管理!

menu.asp  这个是前台执行部分

QUOTE: <%
"---------------------------------------
"作者:野 草
"日期:2006年4月24日
"Q  Q:94440079
"51群:21643964(51JS.COM的群)
"网站:http://www.yecaoweb.com OR http://www.yecaoweb.net
"---------------------------------------
"读取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&""&menu_name&""
Else
menu_temp=menu_temp&"┊"&menu_name&""
End If
Else
If m=0 Then
menu_temp=menu_temp&""&menu_name&""
Else
menu_temp=menu_temp&"┊"&menu_name&""
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:


index.asp
News.asp
Art.asp
Pic.asp
Dj.asp
Down.asp
留言讨论" open="0">Book.asp
Link.asp


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
%>











注:由于时间问题,没来得及测试!我^_^#
:shifty:

本文来源:http://www.bbyears.com/aspjiaocheng/9689.html

热门标签

更多>>

本类排行