send.asp

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

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

Dim vRoomNo

vRoomNo = Session("RoomNo")

Application.Lock
AddLineToChat(CStr(Request.Form("Msg")))
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 + -
显示快捷键?