'******************************
'函数: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
%>
您可能感兴趣的文章:
如您对本文有疑问或者有任何想说的,请 点击进行留言回复,万千网友为您解惑!
网友评论