HexLookup quick examples
See also the examples for HexIcmp and HexTcpQuery.
Visual Basic 5.0
'Be sure to select the Hexillion components
'in the Project|References dialog
Dim oLkup As New HexLookup
Dim lAddr As Long
Dim sHost As String
'Look up IP address for domain name
sHost = "www.netscape.com"
lAddr = oLkup.LookUp(sHost)
'Print all retrieved domain name aliases
'using a For Each loop
Dim v As Variant
For Each v In oLkup.Aliases
Debug.Print v
Next
'Print the address as a string
Debug.Print oLkup.AddrToString(lAddr)
'Do a reverse lookup on the address
Debug.Print oLkup.ReverseLookUp(lAddr)
'Get information about the local host
Debug.Print "---"
Debug.Print oLkup.HostName
lAddr = oLkup.LookUp(oLkup.HostName)
'Print all the local IP addresses using
'a For loop, Count, and indexes
Dim l As Long
For l = 1 To oLkup.Addrs.Count
lAddr = oLkup.Addrs(l)
Debug.Print oLkup.AddrToString(lAddr)
Next
|