Vérifiez le format IP <%
'*******************************
'Fonction: Checkip (par_strip)
'Arguments: chaîne à détecter par str
'Auteur: Alixi
'Date: 2007/7/13
'Description: Vérifiez le format IP, renvoyez 1, sinon renvoyez 0
'Exemple: <% = Checkip ("219.45.23.11")%>
'*******************************
FonctionCheckip (par_strip)
Checkip = 0
Dimtmplop, tmptr
tmptr = par_strip
Iftmptr = "" orisnull (tmptr) alorsxitfunction
tmptr = Split (tmptr, ".")
IfnotisArray (tmptr) alorsxitfunction
FORTMPOOP = 0TOUBOUND (TMPSTR)
Iftmptr (tmplop) = "" orisnull (tmptr (tmplop)) alorsxitfunction
Ifnotisnumeric (TMPSTR (TMPOloop)) alorsxitfunction
Ifcint (tmptr (tmpolop))> 255orcint (tmptr (tmplop)) <1ThenexitFunction
Suivant
Checkip = 1
Finition de fin
%>