if num>1000 then
response.write "<script>alert('用户超过1000了');history.back(-1);</script>"
response.end
end if
dim pwd(1000),user(1000)
for j=1 to num
p=0
p=p+j
user(j)=userstart&p
next
for i=1 to num
pwd(i)=gen_key(5)
next
for k=1 to num
response.write user(k)&"<br>"
response.write pwd(k)&"<br>"
next
<%
if request("action")="select" then
StudentNum=request.form("StudentNum")
if studentnum="" then
response.write "<script>alert('请填写你的学号,我的兄弟姐妹!');location.href='index.asp?'</script>"
response.end
elseif not IsNumeric(studentNum) then
response.write "<script>alert('学号居然不是数字,个性!');location.href='index.asp?'</script>"
response.end
elseif len(studentNum)<>9 and len(studentNum)<>6 and len(studentNum)<>8 then
response.write "<script>alert('你的学号真特别,跟别人的不一样长!');location.href='index.asp?'</script>"
response.end
elseif int(left(studentNum,2))<>99 and int(left(studentNum,2))<>00 and int(left(studentNum,2))<>01 and int(left(studentNum,2))<>02 then
response.write "<script>alert('你的学号还真特别,明显是假的嘛,莫非你已经毕业N年?!');location.href='index.asp?'</script>"
response.end
end if%>
<tr><td><%Selected(StudentNum)%></td></tr>
<%elseif request("action")="probqq" then
first=request.form("first")
num=request.form("num")
if first="" or num="" then
response.write "<tr><td align=middle>信息填写不完整</td></tr>"
else
'号码选择
function Selected(studentnum)
set rs=conn.execute("select id from bqquser where StudentNum='"&StudentNum&"'")
if rs.eof then
Set rs1 = Server.CreateObject("ADODB.Recordset")
sql1="select bqqnum,password,studentnum,selected,pass,addtime from bqquser where selected=0 order by id"
rs1.Open sql1,conn,1,3
Randomize
for i=0 to Int((rs1.recordcount)*Rnd +0)
rs1.movenext
next
bqq=rs1(0)
password=rs1(1)
rs1(2)=studentnum
rs1(3)=true
rs1(4)=false
rs1(5)=now()
rs1.update
response.write "<center>"&StudentNum&",你的BQQ号码已经生成,号码:"&Bqq&" 密码:"&Password&"<br><font color=blue>请持本人学生证到学生之友网站办公室(研究生东馆一楼)开通此号,号码开通后请第一时间更改密码</font><br><a href='javascript:history.back();'>返回</a></center>"
rs1.close
set rs1=nothing
else
response.write "<script>alert('此学生证号已经被注册!');location.href='index.asp?'</script>"
end if
rs.close
set rs=nothing
end function
function ProBqqNum(first,num)
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from bqquser"
rs.Open sql,conn,1,3
for i=first to int(first)+int(num)-1
rs.addnew
rs("bqqnum")=i
rs("password")=PasswordPro()
rs("selected")=false
rs.update
next
rs.close
set rs=nothing
response.write "<tr><td align=center>号码生成成功,号码范围:"&first&"--"&int(first)+int(num)&"</td></tr>"
end function
Function PasswordPro()
Dim stringc,stringlist,stringnum,i,stringnum2
randomize timer
stringc="0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"
stringlist=split(stringc,",")
for i=0 to 35
stringnum=Int((35)*Rnd +0)
PasswordPro=PasswordPro&stringlist(stringnum)
next
stringnum2=Int((29)*Rnd +1)
PasswordPro=mid(PasswordPro,stringnum2,5)
end Function
'退出注销
if request("action")="loginout" then
session("loginok")=false
end if
'登陆管理
if request("action")="check" then
username=request.form("username")
password=request.form("password")
set rs=conn.execute("select password from admin where username='"&username&"'")
if rs.eof then
session("loginok")=false
response.write "<script>alert('你以为你是谁啊??走错地方了吧?!');location.href='index.asp?'</script>"
else
if rs(0)=password then
session("loginok")=true
else
session("loginok")=false
end if
end if
rs.close
set rs=nothing
end if%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Bqq管理</title>
<link href="bqq.css" rel="stylesheet" type="text/css">
</head>