📄 del.aspx
字号:
<%@ Import namespace="system.data.oledb" %>
<%@ Import namespace="system.data" %>
<%@ Page Language="vb" AutoEventWireup="false"%>
<%
If Session("name") <> ConfigurationSettings.AppSettings("站长") Then Response.Redirect("default.aspx")
Dim ID As String, page As String, conn As OleDbConnection, comd As OleDbCommand, dr As OleDbDataReader
Dim theTime As Date
ID = Request.QueryString("ID")
page = Request.QueryString("page")
If ID = "" Or IsNumeric(ID) = False Then Response.redirect("default.aspx")
conn = New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & Server.MapPath(ConfigurationSettings.AppSettings("数据库")))
comd = New OleDbCommand("Select 时间 From 留言 Where ID=" + ID, conn)
comd.Connection.Open()
dr = comd.ExecuteReader
If dr.Read Then
theTime = dr(0)
Else
Response.Redirect("default.aspx")
End If
comd.Connection.Close()
comd.CommandText = "Delete From 留言 Where ID=" + ID
comd.Connection.Open()
comd.ExecuteNonQuery()
comd.Connection.Close()
comd.Dispose()
conn.Close()
conn.Dispose()
Dim ds As DataSet = New DataSet()
ds.ReadXml(Server.MapPath("data\count.xml"))
If DateValue(theTime) = DateValue(ds.Tables(0).Rows(0)(4)) Then ds.Tables(0).Rows(0)(0) = CInt(ds.Tables(0).Rows(0)(0)) - 1
ds.Tables(0).Rows(0)(2) = CInt(ds.Tables(0).Rows(0)(2)) - 1
ds.Tables(0).Rows(0)(4) = Date.Now
ds.AcceptChanges()
ds.WriteXml(Server.MapPath("data\count.xml"))
ds.Clear()
ds.Dispose()
Response.Redirect("default.aspx?page=" + page)
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -