国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

一些值得一看的代碼asp

2024-05-04 11:02:20
字體:
供稿:網(wǎng)友
Asp中對ip進(jìn)行過濾限制函數(shù)
<%
'獲取訪問者的地址
ip=Request.ServerVariables("REMOTE_ADDR")
'允許的IP地址段為10.0.0.0~10.68.63.255
allowip1="10.0.0.0"
allowip2="10.68.10.71"
response.write checkip(ip,allowip1,allowip2)
function checkip(ip,allowip1,allowip2)
dim check(4)
checkip=false
ipstr=split(ip,".")
allow1=split(allowip1,".")
allow2=split(allowip2,".")
if cint(allow1(0))>cint(allow2(0)) then
'判斷IP地址段是否合法
response.write "IP地址段出錯!"
exit function
end if
for i=0 to ubound(ipstr)
if cint(allow1(i))<cint(allow2(i)) then
if cint(allow1(i))=cint(ipstr(i)) then
check(i)=true
checkip=true
exit for
elseif cint(ipstr(i))<cint(allow2(i)) then
check(i)=true
checkip=true
exit for
elseif cint(ipstr(i))>cint(allow2(i)) then
check(i)=false
checkip=false
exit for
else
check(i)=true
checkip=true
end if
end if
end if
elseif cint(allow1(i))>cint(ipstr(i)) or cint(allow1(i))<cint(ipstr(i)) then
check(i)=false
checkip=false
if i<>ubound(ipstr) then
exit for
end if
else
check(i)=true
end if
end if
next
if (check(0)=true and check(1)=true and check(2)=true and check(3)=false) and (cint(allow2(2))>cint(ipstr(2))) then
checkip=true
end if
end function
%>


<%
'列舉使用HTML表單提交的所有值
For Each item In Request.Form
     Response.Write Request.Form(item)
Next
%>
列舉使用HTML表單提交的所有值 

利用ASP得到圖片尺寸大小 
<%  
imgpath="default_22.gif"

set  pp=new  imgInfo  
w = pp.imgW(server.mappath(imgpath))  
h = pp.imgH(server.mappath(imgpath)) 
set pp=nothing 

response.write "<img src='"&imgpath&"' border=0><br>寬:"&w&";高:"&h


Class  imgInfo  
dim  aso  
Private  Sub  Class_Initialize  
   set  aso=CreateObject("Adodb.Stream")  
   aso.Mode=3    
   aso.Type=1    
   aso.Open    
End  Sub  
Private  Sub  Class_Terminate
   err.clear
   set  aso=nothing  
End  Sub  

Private  Function  Bin2Str(Bin)  
   Dim  I,  Str  
發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 大邑县| 岳普湖县| 永顺县| 化州市| 长葛市| 革吉县| 石阡县| 永修县| 衡南县| 巍山| 富锦市| 长岛县| 铅山县| 肥西县| 萍乡市| 吉林市| 外汇| 安吉县| 临洮县| 济宁市| 陆良县| 南昌县| 吴川市| 弋阳县| 平邑县| 平利县| 阿坝| 巴林左旗| 肥西县| 灵石县| 绥化市| 乌鲁木齐县| 龙游县| 阿城市| 赞皇县| 平塘县| 贵南县| 万全县| 庆安县| 徐州市| 永康市|