📄 update.asp
字号:
<%
'get info from client
No=request.QueryString("No")
'connect to user database
Set Conn=Server.CreateObject("ADODB.Connection")
Connstr="DBQ="+server.mappath("user.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;ImplicitCommitSync=Yes;MaxBufferSize=512;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UserCommitSync=Yes;"
Conn.Open connstr
updated="yes"
temptext=".%0D"
goon=false
offline="no"
'user indetify
sql="SELECT * FROM 用户表 WHERE 在线编号='" & No & "'"
Set Rs=conn.Execute(sql)
if Rs.Bof OR Rs.Eof Then
temptext="%0D你已掉线,请重新登录!%0D"
offline="yes"
else
username=Rs("用户名")
goon=true
end if
'recieve message from database
if goon=true then
sql="SELECT * FROM 信息池 WHERE 收信人='" & username & "'"
Set Rs=conn.Execute(sql)
if NOT (Rs.Bof OR Rs.Eof) Then
temptext=""
while NOT Rs.Eof
poster=Rs("发信人")
postime=Rs("发信时间")
postwords=Rs("正文")
temptext=temptext & "%0D" & "[" & poster & "]于" & postime & "对你说:%0D" & postwords & "%0D"
Rs.MoveNext
wend
end if
sql="DELETE * FROM 信息池 WHERE 收信人='" & username & "'"
conn.Execute(sql)
end if
Rs.close
set Rs=nothing
conn.close
set conn=nothing
' return
ReturnValue="updated=" & updated & "&temptext=" & temptext & "&offline=" & offline
response.write(ReturnValue)
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -