⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 post.asp

📁 关于聊天系统的源代码 asp编程 未完整版
💻 ASP
字号:
<%
Response.Buffer =true
if not isarray(session("dv_user")) then 
Response.Write "未登陆不能发言!"
Response.End 
end if
dv_user=session("dv_user")
username=dv_user(0)
userline=dv_user(1)
sendtime=dv_user(2)
send_time=now()
if Instr(LCase(Application("onlinelist")),LCase(username&" "))=0 then
Response.Write "<script>alert('您与服务器断开联接,请刷新页面!');</script>"
Response.End 
end if
if datediff("s",sendtime,send_time)<3 then
Response.Write "<script>alert('两次发言时间需间隔3秒!');</script>"
Response.End 
end if
saystr=Request.Form ("post_msg")
towho=Request.Form ("towho")
addsays=Request.Form ("addsays")
addwordcolor=Request.Form ("addwordcolor")
sayscolor=Request.Form ("sayscolor")
towhoway=Request.Form ("towhoway")
if sayscolor="" or addwordcolor="" then Response.End 
if towho<>"大家" then 
if Instr(LCase(Application("onlinelist")),LCase(towho&" "))=0 then
Response.Write "<script>alert('"&towho&"目前己离开聊天室!');</script>"
response.end
end if
end if
if towhoway<>1 then towhoway=0
if Instr(saystr,"[tu]")<>0 then
dim reg
set reg=new regexp
reg.IgnoreCase=true
reg.Global=true
reg.Pattern="(\[tu\])([1234567890])(\[\/tu\])"
saystr=reg.Replace(saystr,"<img src=logo/$2.gif>")
reg.Pattern="(\[tu\]1)([1234567890])(\[\/tu\])"
saystr=reg.Replace(saystr,"<img src=logo/1$2.gif>")
set reg=nothing
end if

'if towhoway=1 and (towho="大家" or towho=username) then 
'Response.Write "<script>alert('不能对自己或大家私聊!');</script>"
'Response.End 
'end if
act=0
if left(saystr,2)="//" then 
act=1
saystr=mid(saystr,3,len(saystr))
addsays=0
else
if addsays="" then 
addsays="对"
else
addsays=addsays&"对"
end if 
end if
SayStr="parent.getmsg('"&username&"','"&towho&"','"&addsays&"','"&saystr&"','"&act&"','"&addwordcolor&"','"&sayscolor&"','"&towhoway&"','"&time()&"');"
Application.Lock
sd=Application("chat_sd")
line=int(Application("chat_line"))
Application("chat_line")=line+1
Dim newsd(50)
j=1
for i=3 to 50 step 2
newsd(j)=sd(i)
newsd(j+1)=sd(i+1)
j=j+2
next
newsd(49)=line+1
newsd(50)=SayStr
Application("chat_sd")=newsd
Application.UnLock
sd=Application("chat_sd")
newuserline=0
for i=1 to 50 step 2
newuserline=sd(i)
if sd(i)>userline  then
Response.Write "<script language=javascript>"&sd(i+1)&"</script>"
end if
next
dv_user(1) = newuserline
dv_user(2) = send_time
session("dv_user")=dv_user
Response.End
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -