PVPGN中使用ASP页面调用xml做战网排行榜

首先你要开启pvpgn的xml输出功能。修改bnetd.conf最后两项关于xml输出的开关

以下是显示天梯文件的ASP代码:
<%
dim node,i,nodecount
set Doc = CreateObject("MSXML2.DOMDocument.3.0")
Doc.async = false
'请改成你相应xml文件的位置
Doc.load(Server.MapPath("如:pvpgn/pvpgn-1.7.9/var/status/xxxx.xml"))
set root = Doc.documentElement
set nodeLis = root.childNodes
nodeCount = nodeLis.length
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>中国战网积分排行榜</title>
</head>

<body>
<div align="center"><strong>中国战网积分排行榜
</strong></div>
<table width="700"  border="1" cellpadding="0" cellspacing="0" align="center">
 <tr align="center">
   <td>排名</td>
   <td>姓名</td>
   <td>级别</td>
   <td>经验</td>
   <td>胜利</td>
   <td>失败</td>
 </tr>
<%
For i=1 to nodeCount
set node = nodeLis.nextNode()
%>
 <tr align="center">
   <td><%=node.selectSingleNode("rank").text%></td>
   <td><%=node.selectSingleNode("name").text%></td>
   <td><%=node.selectSingleNode("level").text%></td>
   <td><%=node.selectSingleNode("xp").text%></td>
   <td><%=node.selectSingleNode("wins").text%></td>
   <td><%=node.selectSingleNode("losses").text%></td>
 </tr>
<% Next %>
</table>
<p>制作:中国战网 </p>
</body>
</html>
引用通告地址: 点击获取引用地址
评论: 0 | 引用: 0 | 阅读: 1074 | 打印 | 打包 | 转发
 加入网摘