message.asp

来自「flashchat 基于flash的聊天室」· ASP 代码 · 共 45 行

ASP
45
字号
<%@Language = "VBScript"%>
<%
Option Explicit
Response.Buffer = True
Response.Expires = -1000

Dim vRoomNo
Dim vPrivateMessage
vRoomNo = Session("RoomNo")

vPrivateMessage = Trim(Request.Form("PrivateMessage"))
If vPrivateMessage <> "" Then
	Application.Lock
	AddLineToChat("/msg " & Request.Form("UserName") & " " & Session("ChatName") & ": " & vPrivateMessage)
	AddLineToChat("/msg " & Session("ChatName") & " " & Request.Form("UserName") & ": " & vPrivateMessage)
End If
Response.Write "Result=OK"
Application.Unlock

Response.Flush
Response.End

Sub AddLineToChat(ByVal vNewLine)

	Dim vCurrentLine, vChatLines, vMaxLines

	vCurrentLine = Application("ChatLineCount" & vRoomNo)
	vChatLines = Application("ChatLines" & vRoomNo)
	vMaxLines = Application("ChatMaxLines" & vRoomNo)
	vCurrentLine = vCurrentLine + 1
	If vCurrentLine > vMaxLines Then
		vMaxLines = vMaxLines + 500
		If vCurrentLine = 1 Then
			Redim vChatLines(vMaxLines)
		Else
			Redim Preserve vChatLines(vMaxLines)
		End If
		Application("ChatMaxLines" & vRoomNo) = vMaxLines
	End If
	vChatLines(vCurrentLine - 1) = vNewLine
	Application("ChatLines" & vRoomNo) = vChatLines
	Application("ChatLineCount" & vRoomNo) = vCurrentLine
	
End Sub
%>

⌨️ 快捷键说明

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