ASP to verify the function of IP format _ application techniques
Source: Internet
Author: User
Verifying IP format <%
'******************************
' Function: Checkip (Par_strip)
' parameter: str string to be detected
' Author: Arisisi
' Date: 2007/7/13
' Description: Verify the IP format, is to return 1, otherwise return 0
' Example: <%=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 Exit Function
Next
Checkip =1
End Function
%>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service