📄 const.asp
字号:
<%
Dim UserAgent,ScriptName,CategoryName,cookies_path_s,cookies_path_d,cookies_path
UserAgent=Trim(lcase(Request.Servervariables("HTTP_USER_AGENT")))
ScriptName=lcase(request.ServerVariables("PATH_INFO"))
CategoryName="SoftDown"
cookies_path_s=split(Request.ServerVariables("PATH_INFO"),"/")
cookies_path_d=ubound(cookies_path_s)
cookies_path="/"
for i=1 to cookies_path_d-1
if not (cookies_path_s(i)="upload" or cookies_path_s(i)="admin") then cookies_path=cookies_path&cookies_path_s(i)&"/"
next
dim sql,rs,System_Info,System_Setting,UserClass,LicenceType,Language,SoftType,System,default_system
dim cUserName,cPassword,cUserClass,cUserID
cUserName=request.Cookies("mesky")("username")
cPassword=request.Cookies("mesky")("password")
cUserClass=request.Cookies("mesky")("userclass")
cUserID=request.Cookies("mesky")("userid")
sql="select * from SoftDown_Config where id=1"
set rs=conn.execute(sql)
if rs.eof and rs.bof then
response.write "系统出现错误,请联系网站管理员。"
response.end
else
System_Info=split(rs("System_Info"),",")
System_Setting=split(rs("System_Setting"),",")
UserClass=split(rs("UserClass"),",")
LicenceType=split(rs("LicenceType"),",")
Language=split(rs("Language"),",")
SoftType=split(rs("SoftType"),",")
System=split(rs("System"),",")
default_system=rs("default_system")
end if
rs.close
dim strHeader,strFooter
sql="select Header,Footer from SoftDown_Template where isActive=true"
set rs=conn.execute(sql)
if rs.eof and rs.bof then
strHeader="":strFooter=""
else
strHeader=rs(0):strFooter=rs(1)
end if
rs.close
set rs=nothing
if cint(System_Setting(2))=1 then
Dim SplitReflashPage
Dim DoReflashPage
DoReflashPage=false
if trim(System_Setting(4))<>"" then
SplitReflashPage=split(System_Setting(4),"|")
for i=0 to ubound(SplitReflashPage)
if instr(scriptname,SplitReflashPage(i))>0 then
DoReflashPage=true
exit for
end if
next
end if
if (not isnull(session("ReflashTime"))) and cint(System_Setting(3))>0 and DoReflashPage then
if DateDiff("s",session("ReflashTime"),Now())<cint(System_Setting(3)) then
response.write "<META http-equiv=Content-Type content=text/html; charset=gb2312><meta HTTP-EQUIV=REFRESH CONTENT=3>本页面起用了防刷新机制,请不要在"&System_Setting(3)&"秒内连续刷新本页面<BR>正在打开页面,请稍后……"
response.end
else
session("ReflashTime")=Now()
end if
elseif isnull(session("ReflashTime")) and cint(System_Setting(3))>0 and DoReflashPage then
Session("ReflashTime")=Now()
end if
end if
if (instr(scriptname,"admin")=0 and instr(scriptname,"login")=0 and instr(scriptname,"chklogin")=0) or cint(System_Setting(1)) then
if LockIP(Request.ServerVariables("REMOTE_ADDR")) then
response.write "您的IP已经被限制不能访问本系统,请和管理员联系。"
response.end
end if
end if
'用户IP限制
function LockIP(sip)
dim str1,str2,str3,str4
dim num
LockIP=false
if isnumeric(left(sip,2)) then
str1=left(sip,instr(sip,".")-1)
sip=mid(sip,instr(sip,".")+1)
str2=left(sip,instr(sip,".")-1)
sip=mid(sip,instr(sip,".")+1)
str3=left(sip,instr(sip,".")-1)
str4=mid(sip,instr(sip,".")+1)
if isNumeric(str1)=0 or isNumeric(str2)=0 or isNumeric(str3)=0 or isNumeric(str4)=0 then
else
num=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
sql="select count(*) from SoftDown_LockIP where ip1 <="&num&" and ip2 >="&num&""
set rs=conn.execute(sql)
if rs(0)>0 then
LockIP=true
end if
set rs=nothing
end if
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -