Limit a certain IP address

xiaoxiao2021-03-06  50

Function IP2NUM (SIP)

DIM STR1, STR2, STR3, STR4

DIM NUM

IP2NUM = 0

IF IsNumeric (Left (SIP, 2)) THEN

STR1 = Left (SIP, INSTR (SIP, ") - 1)

SIP = MID (SIP, INSTR (SIP, ") 1)

STR2 = Left (SIP, INSTR (SIP, ") - 1)

SIP = MID (SIP, INSTR (SIP, ") 1)

STR3 = Left (SIP, INSTR (SIP, ") - 1)

STR4 = MID (SIP, INSTR (SIP, ") 1)

Num = cint (str1) * 256 * 256 * 256 cint (str2) * 256 * 256 cint (str3) * 256 CINT (STR4) -1

IP2num = NUM

END IF

END FUNCTION

转载请注明原文地址:https://www.9cbs.com/read-115779.html

New Post(0)