asp驗(yàn)證Ip格式的函數(shù)
更新時(shí)間:2007年08月08日 11:50:14 作者:
驗(yàn)證Ip格式<%
'******************************
'函數(shù):CheckIp(paR_strIp)
'參數(shù):str 要檢測(cè)的字符串
'作者:阿里西西
'日期:2007/7/13
'描述:驗(yàn)證Ip格式,是返回1,否則返回0
'示例:<%=CheckIp("219.45.23.11")%>
'******************************
Function CheckIp(paR_strIp)
CheckIp =0
Dim tmpLoop, tmpStr
tmpStr =paR_strIp
If tmpStr ="" Or IsNull(tmpStr) Then Exit Function
tmpStr =Split(tmpStr, ".")
If Not isArray(tmpStr) Then Exit Function
For tmpLoop =0 To ubound(tmpStr)
If tmpStr(tmpLoop) ="" Or IsNull(tmpStr(tmpLoop)) Then Exit Function
If Not isNumeric(tmpStr(tmpLoop)) Then Exit Function
If Cint(tmpStr(tmpLoop)) >255 Or Cint(tmpStr(tmpLoop)) <1 Then Exit Function
Next
CheckIp =1
End Function
%>
'******************************
'函數(shù):CheckIp(paR_strIp)
'參數(shù):str 要檢測(cè)的字符串
'作者:阿里西西
'日期:2007/7/13
'描述:驗(yàn)證Ip格式,是返回1,否則返回0
'示例:<%=CheckIp("219.45.23.11")%>
'******************************
Function CheckIp(paR_strIp)
CheckIp =0
Dim tmpLoop, tmpStr
tmpStr =paR_strIp
If tmpStr ="" Or IsNull(tmpStr) Then Exit Function
tmpStr =Split(tmpStr, ".")
If Not isArray(tmpStr) Then Exit Function
For tmpLoop =0 To ubound(tmpStr)
If tmpStr(tmpLoop) ="" Or IsNull(tmpStr(tmpLoop)) Then Exit Function
If Not isNumeric(tmpStr(tmpLoop)) Then Exit Function
If Cint(tmpStr(tmpLoop)) >255 Or Cint(tmpStr(tmpLoop)) <1 Then Exit Function
Next
CheckIp =1
End Function
%>
相關(guān)文章
asp執(zhí)行帶參數(shù)的sql語(yǔ)句實(shí)例
這篇文章主要介紹了asp執(zhí)行帶參數(shù)的sql語(yǔ)句實(shí)例,參數(shù)化SQL語(yǔ)句可以有效的防止SQL注入漏洞,需要的朋友可以參考下2014-08-08asp cint clng的范圍與防止cint和clng的溢出解決方法大全
首先我們需要了解的是cint范圍 -32,768 到 32,767。 clng范圍 -2,147,483,648 到 2,147,483,647。2008-01-01ASP中DateAdd函數(shù)中日期相加或相減使用方法
本文將介紹ASP中DateAdd函數(shù)中日期相加或相減使用方法,需要了解的朋友可以參考下2012-12-12flash和asp分頁(yè)的一點(diǎn)心得與flash腳本
flash和asp分頁(yè)的一點(diǎn)心得與flash腳本...2007-03-03asp程序執(zhí)行數(shù)據(jù)庫(kù)的效率提升建議
很多網(wǎng)友非常不喜歡用ASP來(lái)編程,他們總是抱怨說(shuō)ASP程序太慢,效率太低。更希望用PHP,JSP等來(lái)寫(xiě)程序。其實(shí)不能從 "認(rèn)為" 這個(gè)角度來(lái)看問(wèn)題 ,而應(yīng)該從實(shí)際中看問(wèn)題,ASP真的很慢的嗎,那么微軟的站為何用ASP也不慢呢2020-09-09