内页代码如下
<%
where usr=Session("usr")
if Request.QueryString("action")="del" then
Dim NewsID
NewsID = Split(Request.Form("chk"),",")
Dim k
For k = 0 To Ubound(NewsID)
Call DeleNews(NewsID(k))
Next
Response.Write("<script>alert('删除成功!')</script>")
end if
Sub DeleNews(NewID)
Dim Rs,FileName
'Set Rs= Conn.Execute("select * from news Where ID="&NewID)
Conn.Execute("delete from news where Id="&newid)
End Sub
Sub DoDelFile(sPathFile)
On Error Resume Next
Dim oFSO
Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
oFSO.DeleteFile(Server.MapPath(sPathFile))
Set oFSO = Nothing
End Sub
Dim Rs
Dim Page,allpage,st,ed
If Request.QueryString("Page")<0 or Request.QueryString("Page")="" then
Page = 1
else
Page = Cint(Request.QueryString("Page"))
End IF
Set Rs = Server.CreateObject("adodb.recordset")
Rs.Open "select * from news order by id desc",Conn,1,1
If Not Rs.eof then
Rs.PageSize = 20
Allpage = Rs.PageCount
IF Page>allpage then page=allpage
Rs.AbsolutePage = page
st = 1
ed = 10
end if
If page >9 then
st = page - 4
ed = page + 4
end if
if ed>allpage then ed = allpage
%>
[
本帖最后由 qq5262866 于 2009-8-7 19:43 编辑 ]