通过本文主要向大家介绍了asp 获取ip,asp 显示ip,asp ip地址,asp 限制ip,asp 限制ip登录网页等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
验证Ip格式<%
'******************************
'函数:CheckIp(paR_strIp)
'参数:str 要检测的字符串
'作者:阿里西西
'日期:2007/7/13
'描述:验证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
%> </div>
'******************************
'函数:CheckIp(paR_strIp)
'参数:str 要检测的字符串
'作者:阿里西西
'日期:2007/7/13
'描述:验证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
%> </div>