2017年4月政治时事:帮我看下这个查询asp 代码什么意思,尽量详细地注解下

来源:百度文库 编辑:高校问答 时间:2024/04/29 04:25:28
<%
Dim UserAgent,ScriptName
UserAgent=Trim(lcase(Request.Servervariables("HTTP_USER_AGENT")))
ScriptName=lcase(request.ServerVariables("PATH_INFO"))

dim sql,rs,SiteName,SiteUrl,Site_Setting,FilmType,FilmServer,FilmLanguage,ViewType
dim AdminName,AdminPass,AdminID
AdminName=request.Cookies("xiao")("AdminName")
AdminPass=request.Cookies("xiao")("AdminPass")
AdminID=request.Cookies("xiao")("AdminID")
sql="select * from site_info"
set rs=conn.execute(sql)
if rs.eof and rs.bof then
response.write "我的系统,请联系网站管理员。"
response.end
else
SiteName=rs("SiteName")
SiteUrl=rs("SiteUrl")
Site_Setting=split(rs("Site_Setting"),",")
FilmType=split(rs("FilmType"),",")
FilmLanguage=split(rs("FilmLanguage"),",")
FilmServer=split(rs("FilmServer"),",")
ViewType=split(rs("ViewType"),",")
end if
rs.close
dim strHeader,strFooter
sql="select Footer from Template_info where isActive=1"
set rs=conn.execute(sql)
if rs.eof and rs.bof then
strFooter=""
else
strFooter=rs(0)
end if
rs.close
set rs=nothing

if (instr(scriptname,"admin")=0 and instr(scriptname,"login")=0 and instr(scriptname,"chklogin")=0) or cint(Site_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 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
%>

最好能帮我注解下,看不明白这段代码???谢谢asp 大侠们,刚学asp ,拿别人的代码来分析,看不懂.