Hàm kiểm tra địa chỉ IP:Function IsValidIp(sIpAddress)
Dim aTmp
IsValidIp = False
aTmp = split(sIpAddress,”.”)
If UBound(aTmp) <> 3 Then Exit Function
For Each field In aTmp
If field > 255 Then Exit Function
Next
IsValidIp = True
End Function
Hàm convert ASCII sang HEX:
Function AsciiToHex(sData)
Dim i, aTmp()
ReDim aTmp(Len(sData) – 1)
For i = 1 To Len(sData)
aTmp(i – 1) = Hex(Asc(Mid(sData, i)))
Next
ASCIItoHex = aTmp
End Function