📄 conn.asp
字号:
<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
dim conn,connstr
dim master
Set Conn=Server.CreateObject("ADODB.Connection")
'Connstr="DBQ="+server.mappath("public/ly.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;ImplicitCommitSync=Yes;MaxBufferSize=512;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UserCommitSync=Yes;"
'connstr="DBQ=" & server.mapPath("public/global.asa") & ";DRIVER={Microsoft Access Driver (*.mdb)};"
connstr ="Provider = Microsoft.Jet.OLEDB.4.0; Data Source ="& Server.MapPath("db/global.asa")
Conn.Open connstr
sub connclose
conn.close
set conn=nothing
end sub
sub rsclose
rs.close
set rs=nothing
end sub
function encodestr(str)
dim i
str=trim(str)
str=replace(str,"<","<")
str=replace(str,">",">")
str=replace(str,"'","""")
str=replace(str,vbCrLf&vbCrlf,"</p><p>")
str=replace(str,vbCrLf,"<br>")
encodestr=replace(str," "," ")
end function
function getMaster()
dim rs, sql,str,LF
LF=chr(10)
sql="select username from [user] where userClass>18"
set rs=conn.execute(sql)
if not (rs.eof and rs.bof ) then
str=rs(0)
rs.movenext
do until rs.eof
str=str & LF & rs(0)
rs.movenext
loop
end if
rs.close
set rs=nothing
getMaster=split(str,LF)
'response.write str
end function
function isMaster(name)
dim i
isMaster=false
for i=0 to ubound(master)
if master(i)=name then
isMaster=true
exit function
end if
next
end function
class users
dim name,pass,reged,master,male,face,email,qq,url,icq,msn,admin
private sub class_initialize()
dim rs,sql
name=request.cookies("gbook")("username")
if name<>"" then
name=vbunescape(name)
end if
pass=request.cookies("gbook")("password")
if name="" or pass="" then
reged=false
master=false
admin=false
male=true
else
sql="select top 1 username,userpassword,useremail,sex,GBface,oicq,icq,msn,homepage,userclass from [user] where username='"&name&"' and userPassword='"&pass&"' "
set rs=conn.execute(sql)
if rs.eof and rs.bof then
reged=false
master=false
admin=false
male=true
else
reged=true
if rs("sex")="1" then
male=true
else
male=false
end if
face=rs("GBface")
email=rs("useremail")
qq=rs("oicq")
icq=rs("icq")
msn=rs("msn")
url=rs("homepage")
if rs("userclass")=20 or rs("userclass")=19 then
master=true
else
master=false
end if
if rs("userclass")=20 then
admin=true
else
admin=false
end if
end if
rs.close
set rs=nothing
end if
end sub
end class
master=getMaster
dim theUser
set theUser=new users
%>
<script language=javascript runat=server>
function vbunescape(s)
{return unescape(s);}
function vbescape(s)
{return escape(s);}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -