手机
当前位置:查字典教程网 >编程开发 >ASP教程 >asp验证Ip格式的函数
asp验证Ip格式的函数
摘要:验证Ip格式255OrCint(tmpStr(tmpLoop))

验证Ip格式<%

'******************************

'函数:CheckIp(paR_strIp)

'参数:str要检测的字符串

'作者:阿里西西

'日期:2007/7/13

'描述:验证Ip格式,是返回1,否则返回0

'示例:<%=CheckIp("219.45.23.11")%>

'******************************

FunctionCheckIp(paR_strIp)

CheckIp=0

DimtmpLoop,tmpStr

tmpStr=paR_strIp

IftmpStr=""OrIsNull(tmpStr)ThenExitFunction

tmpStr=Split(tmpStr,".")

IfNotisArray(tmpStr)ThenExitFunction

FortmpLoop=0Toubound(tmpStr)

IftmpStr(tmpLoop)=""OrIsNull(tmpStr(tmpLoop))ThenExitFunction

IfNotisNumeric(tmpStr(tmpLoop))ThenExitFunction

IfCint(tmpStr(tmpLoop))>255OrCint(tmpStr(tmpLoop))<1ThenExitFunction

Next

CheckIp=1

EndFunction

%>

【asp验证Ip格式的函数】相关文章:

asp中的Rnd 函数

改进一下asp自带的formatNumber函数

文件遍历排序函数

用asp实现无组件生成验证码的方法2种

asp 中常用的文件处理函数

asp 常用函数用法

asp错误的几种处理方式

一个实用asp分页函数

asp中对ip进行过滤限制函数

asp最常用的分页函数

精品推荐
分类导航