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

📄 global.asa

📁 flashchat 基于flash的聊天室
💻 ASA
字号:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Session_OnEnd
	Dim vChatName, vChatUsers, vChatMoods, vUserCount
	Dim vRoomNo
	Dim m, n
	
	vRoomNo = Session("RoomNo")
	vChatName = "" & Session("ChatName")
	If vChatName <> "" Then
		Application.Lock
		vUserCount = CLng(Application("UserCount" & vRoomNo))
		If vUserCount < 2 Then
			vChatUsers = ""
			vChatMoods = ""
			vUserCount = 0
		Else
			vChatUsers = Application("ChatUsers" & vRoomNo)
			vChatMoods = Application("ChatMoods" & vRoomNo)
			For n = 0 To vUserCount - 1
				If vChatUsers(n) = vChatName Then
					For m = n To vUserCount - 2
						vChatUsers(m) = vChatUsers(m+1)
						vChatMoods(m) = vChatMoods(m+1)
					Next
					vUserCount = vUserCount - 1
					Redim Preserve vChatUsers(vUserCount)
					Redim Preserve vChatMoods(vUserCount)
					Exit For
				End If
			Next
		End If
		Application("ChatUsers" & vRoomNo) = vChatUsers
		Application("ChatMoods" & vRoomNo) = vChatMoods
		Application("UserCount" & vRoomNo) = vUserCount
		AddLineToChat vRoomNo, "**" & vChatName & " has left (timed out)**"
		Session("ChatName") = ""
		If vUserCount = 0 Then
			Application("ChatLines" & vRoomNo) = "" 
			Application("ChatLineCount" & vRoomNo) = 0
			Application("ChatMaxLines" & vRoomNo) = 0
		End If
		Application.Unlock
	End If
	
End Sub

Sub AddLineToChat (ByVal vRoomNo, 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
</SCRIPT>

⌨️ 快捷键说明

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