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

📄 main.asp

📁 聊天室
💻 ASP
字号:
<% response.buffer=true %>
<html>

<head>
<title>聊天室</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
</head>
<%
	dim RoomName,UserID
	TimeLogin=now
	set myconn=server.CreateObject ("ADODB.Connection")
	myconn.ConnectionString ="DSN=ChatRoom"
	myconn.Open 

	if Request.ServerVariables ("REQUEST_METHOD")="GET" then
		RoomName=Request.QueryString ("roomname")
		UserID=Request.QueryString ("user")
	else
		RoomName=Request.Form ("newroom")
		UserID=Request.Form ("user")
		Topic=Request.Form ("topic")
		mysql="insert into RoomInfo (RoomName,Topic,WhoCreate) values ('" & RoomName & "','" & Topic & "','" & UserID & "')"
		myconn.Execute (mysql)
	end if

	if session("myname")="" then
		mysql1="update UserOnLine set IPAdd='" & Request.ServerVariables ("Remote_Host") & "',TimeLogin='" & TimeLogin & "',TimeLastTalking='" & TimeLogin & "' where UserID='" & UserID & "'" 
		session("myname")=userID
		session("myroom")=RoomName
	
		mysql="update RoomInfo set HowManyUsers=HowManyUsers+1 where RoomName='" & RoomName & "'"
		myconn.Execute (mysql)
		myconn.Execute (mysql1)
		
		mysql="select UserID from UserOnLine where RoomName='" & RoomName & "'"
		set newrecord=myconn.Execute (mysql)
		
		do while not newrecord.eof
			application(newrecord(0))="<br><font color=purple>" & session("nickname") & "大摇大摆地进来了!(请刷新)<font color=blue size=1>(" & time()  & ")</font><br><br>" & application(newrecord(0))
			newrecord.movenext
		loop
		
		if application(UserID)="" then
			application(UserID)=application(RoomName)
		end if
	end if
	myconn.Close 
	set myconn=nothing	

%>

<script language="javascript">
<!--
//parent.frames(2).location.href="talker.asp"
//-->
</script>


<frameset cols="80%,*">
  <frameset rows="75%,*">
    <frame name="ltop" target="ltop" scrolling="auto" noresize src="content.asp?roomname=<% =RoomName %>&user=<% =UserID %>">
    <frame name="lbottom" noresize scrolling="auto" noresize src="send.asp?roomname=<% =RoomName %>&user=<% =UserID %>">
  <frame src="UntitledFrame-1"></frameset>
  <frameset rows="75%,*">
    <frame name="rtop" target="rbottom" scrolling="auto" noresize src="talker.asp">
    <frame name="rbottom" scrolling="auto" noresize src="exit.asp">
  </frameset>
  <noframes>
  <body>
  <p>This page uses frames, but your browser doesn't support them.</p>
  </body>
  </noframes>
</frameset>
</html>

⌨️ 快捷键说明

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