28,391
社区成员
发帖
与我相关
我的任务
分享
<%@ Language=VBScript %>
<!--#include file="webConn.asp" -->
<%
Dim PageSize
dim rs
PageSize=15
Dim i
Dim intPageCount
Dim intRecordCount
Dim page
if isempty(Request("Page")) then
Page=1
else
if isnumeric(request("page")) then
on error resume next
Page=clng(abs(Request("Page")))
if err.number<>0 then
Page=1
err.clear
end if
on error goto 0
else
Page=1
end if
end if
Response.ContentType = "text/xml"
Response.Expires = -1
Response.Write "<?xml version='1.0' encoding='GB2312'?>"
Response.Write "<threads "
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open "select * from news order by id desc",con,3
intRecordCount=rs.RecordCount
if not (rs.EOF and rs.BOF) then
rs.PageSize=PageSize
intPageCount=rs.PageCount
if page>intPageCount then
page=intPageCount
end if
rs.AbsolutePage=Page
Response.Write "PageCount="""&intPageCount&""" RecordCount="""&intRecordCount&""" AdminLog="""&AdminLogFlag&""">"
for i=1 to pagesize
if rs.EOF then
exit for
end if
Response.Write "<message>"
Response.Write "<id>"
Response.Write rs("id")
Response.Write "</id>"
Response.Write "<date>"
Response.Write rs("date")
Response.Write "</date>"
Response.Write "<body><![CDATA["
Response.Write rs("content")
Response.Write "]]></body>"
Response.Write "</message>"
rs.MoveNext
NEXT
END IF
rs.Close
Set rs=nothing
Response.Write "</threads>"
%>