最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

ASP XML制作菜單管理程序

 更新時(shí)間:2008年12月29日 20:52:13   作者:  
利用asp+xml實(shí)現(xiàn)代碼管理,實(shí)際就是利用asp操作xml
以下是menu.asp代碼
程序代碼
<%
'---------------------------------------
'作者:野 草
'日期:2006年4月24日
'Q Q:94440079
'---------------------------------------
'讀取XML文件函數(shù)
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
'判斷是否是第一個(gè),若是第一個(gè)則去掉"┊"
If m=0 Then
menu_temp=menu_temp&"<a href='"&menu_url&"'>"&menu_name&"</a>"
Else
menu_temp=menu_temp&"┊<a href='"&menu_url&"'>"&menu_name&"</a>"
End If
Else
If m=0 Then
menu_temp=menu_temp&"<a href='"&menu_url&"' target='o'>"&menu_name&"</a>"
Else
menu_temp=menu_temp&"┊<a href='"&menu_url&"' target='o'>"&menu_name&"</a>"
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 version="1.0" encoding="gb2312"?>
<xml>
<menu>
<url name="網(wǎng)站首頁(yè)" open="0">index.asp</url>
<url name="新聞動(dòng)態(tài)" open="0">News.asp</url>
<url name="文章中心" open="0">Art.asp</url>
<url name="圖片展示" open="0">Pic.asp</url>
<url name="影音娛樂(lè)" open="0">Dj.asp</url>
<url name="資源下載" open="0">Down.asp</url>
<url name="留言討論" open="0">Book.asp</url>
<url name="友情連接" open="0">Link.asp</url>
</menu>
</xml>
admin_menu.asp 后臺(tái)管理XML文件部分
以下是admin_menu.asp
程序代碼
<%
'利用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
%>
<html>
<head>
<title></title>
</head>
<body>
<form action="?action=ok" method="post">
<textarea style='width:500px;height:200px;' name='content'>
<%=server.execute("menu.xml")%>
</textarea>
<input type='submit' value='修 改' />
</form>
</body>
</html>

相關(guān)文章

最新評(píng)論

宁南县| 福泉市| 准格尔旗| 沂水县| 渝中区| 繁昌县| 天峨县| 涟源市| 邵阳市| 彭泽县| 玛多县| 封开县| 营口市| 南阳市| 顺义区| 商水县| 桃园县| 龙泉市| 杭锦后旗| 兴和县| 永顺县| 六枝特区| 永胜县| 四子王旗| 濮阳县| 诏安县| 会泽县| 凤城市| 宁河县| 谢通门县| 元氏县| 镇原县| 元朗区| 巴塘县| 资兴市| 平阳县| 托克逊县| 且末县| 新晃| 佛冈县| 星座|