揭秘asp常用函数库大全(2)_ASP教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

推荐:详解将ASP页面改为伪静态的简单方法
目前很多网站都采用生成静态页的方法,原因是这样访问速度会得到提高(服务器端CPU利用率很低),另外也容易被搜索引擎收录,但是这带来的一个问题就是需要足够大的空间存放这些静态页面,如果你的空间不是很富裕,而又想有利于被搜索引擎收录,其实可以采用伪


Function IP2Num(sip)
’--------------------限制某段IP地址

    dim str1,str2,str3,str4
    dim num
    IP2Num=0
    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)
        num=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
        IP2Num = num
    end if
end function

’userIPnum = IP2Num(Request.ServerVariables("REMOTE_ADDR"))
’if userIPnum > IP2Num("192.168.0.0") and userIPnum < IP2Num("192.168.0.255") then
    ’response.write ("<center>您的IP被禁止</center>")
    ’response.end
’end if


Function chkFrom() 
’----------------------------防站外提交设定
    Dim server_v1,server_v2, server1, server2
    chkFrom=False 
    server1=Cstr(Request.ServerVariables("HTTP_REFERER"))
    server2=Cstr(Request.ServerVariables("SERVER_NAME"))
    If Mid(server1,8,len(server2))=server2 Then chkFrom=True 
End Function
’if not chkFrom then
    ’Response.write("请不要从站外提交内容!")
    ’Response.end
’End if

function getsys()
’----------------------------------操作系统检测
vibo_soft=Request.ServerVariables("HTTP_USER_AGENT")
if instr(vibo_soft,"Windows NT 5.0") then
    msm="Win 2000"
elseif instr(vibo_soft,"Windows NT 5.1") then
    msm="Win XP"
elseif instr(vibo_soft,"Windows NT 5.2") then
    msm="Win 2003"
elseif instr(vibo_soft,"4.0") then
    msm="Win NT"
elseif instr(vibo_soft,"NT") then
    msm="Win NT"
elseif instr(vibo_soft,"Windows CE") then
    msm="Windows CE"
elseif instr(vibo_soft,"Windows 9") then
    msm="Win 9x"
elseif instr(vibo_soft,"9x") then
    msm="Windows ME"
elseif instr(vibo_soft,"98") then
    msm="Windows 98"
elseif instr(vibo_soft,"Windows 95") then
    msm="Windows 95"
elseif instr(vibo_soft,"Win32") then
    msm="Win32"
elseif instr(vibo_soft,"unix") or instr(vibo_soft,"linux") or instr(vibo_soft,"SunOS") or instr(vibo_soft,"BSD") then
    msm="类Unix"
elseif instr(vibo_soft,"Mac") then
    msm="Mac"
else
    msm="Other"
end if
getsys=msm
End Function

分享:解析有关eWebEditor网页编辑器的漏洞
首先介绍编辑器的一些默认特征: 默认登陆admin_login.asp 默认数据库db/ewebeditor.mdb 默认帐号admin密码admin或admin888 在baidu/google搜索inurl:ewebeditor 几万的站起码有几千个是具有默认特征的,那么试一下默认后台 http://www.xxx.com.cn/admin/eweb

来源:模板无忧//所属分类:ASP教程/更新时间:2010-04-24
相关ASP教程