ตรวจสอบรูปแบบ IP <%
-
'ฟังก์ชั่น: checkip (par_strip)
'อาร์กิวเมนต์: สตริงที่ตรวจพบโดย STR
'ผู้แต่ง: Alixi
'วันที่: 2007/7/13
'คำอธิบาย: ตรวจสอบรูปแบบ IP, return 1, return 0
'ตัวอย่าง: <%= CHECTIP ("219.45.23.11")%>
-
functionCheckip (par_strip)
CHATCH = 0
dimtmploop, tmpSTR
tmpsttr = par_strip
iftmpStr = "" orisnull (tmpstr) thenexitfunction
TMPSTR = แยก (TMPSTR, ".")
ifnotisarray (TMPSTR) thenexitfunction
fortmploop = 0toubound (TMPSTR)
iftmpStr (tmploop) = "" orisnull (tmpstr (tmploop)) thenexitfunction
ifnotisnumeric (TMPSTR (TMPLOOP)) THEEXITFUNCTION
IFCINT (TMPSTR (TMPLOOP))> 255orCint (TMPSTR (TMPLOOP)) <1theneXitFunction
ต่อไป
CHECTIP = 1
endfunction
-