📄 creatroom.asp.1
字号:
<%Response.Expires=0
Server.ScriptTimeout=300
dim input(),online()
username = Request.Form("name")
password = Request.Form("pass")
if username="" or password="" then
response.write"对不起您没有输入房间名!或者没有输入密码!!!"
response.end
end if
counter=0
allon=0
rooms = server.mappath("rooms.asp")
Set fs = CreateObject("Scripting.FileSystemObject")
set thisfile = fs.OpenTextFile(rooms,1,False)
do while not thisfile.AtEndOfStream
thisline = thisfile.readline
old=split(thisline,"|-!-|")
if old(0)=username then
if old(1)=password then
session("vchat_user")=username
session("vchat_pass")=password
url=Server.URLEncode("room/"&username&".asp")
Response.Redirect url
set fs=nothing
Response.end
else
response.write "对不起!这个房间已经创建,请确认室主密码"
set fs=nothing
response.end
end if
end if
Redim preserve input(counter)
input(counter) = thisline
counter = counter + 1
loop
thisfile.Close
Set outfile = fs.CreateTextFile(rooms)
outfile.WriteLine "response.end"
outfile.WriteLine username&"|-!-|"&password
for i=1 to counter-1
outfile.WriteLine input(i)
next
outfile.close
dim indexline()
counter=0
index = server.mappath("room.asp")
set thisfile = fs.OpenTextFile(index,1,False)
do while not thisfile.AtEndOfStream
thisline = thisfile.readline
Redim preserve indexline(counter)
indexline(counter) = thisline
counter = counter + 1
loop
roomname = server.mappath("room/"&username&".asp")
set thisfile = fs.OpenTextFile(roomname,1,True)
Set outfile = fs.CreateTextFile(roomname)
for i=1 to counter-1
outfile.WriteLine indexline(i)
next
outfile.WriteLine "<script language=javascript>alert('欢迎光临"&username&"语音聊天室')</script>"
outfile.close
set fs=nothing
session("vchat_user")=username
session("vchat_pass")=password
url=Server.URLEncode("room/"&username&".asp")
Response.Redirect url
Response.end
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -