国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 江油市| 随州市| 沭阳县| 宜兴市| 武穴市| 辽阳县| 珠海市| 赤水市| 集安市| 嘉峪关市| 永春县| 崇州市| 阿克苏市| 栾城县| 勃利县| 北安市| 巴塘县| 常德市| 丰县| 孟村| 卢氏县| 卢龙县| 峡江县| 五家渠市| 上高县| 江都市| 西峡县| 洮南市| 绍兴县| 安陆市| 栾川县| 无棣县| 杭锦后旗| 观塘区| 台江县| 闽清县| 临武县| 晴隆县| 桐柏县| 富阳市| 乌鲁木齐市|