Results 1 to 2 of 2

Thread: IP Resolver

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2009
    Posts
    18

    IP Resolver

    Stuck on resolving host IPs within a listbox. I want it to carry over the resolved IP's to listbox2. But also have an 2 radio options either to resolve IP to Hostname or resolve Hostname to IP. Thus when I hit the start button, it checks to see which one is selected and starts the process. Here is what I have found, but can there be a simplified version to this but for lists? http://vbnet.mvps.org/index.html?cod...k/iplookup.htm

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: IP Resolver

    You can get the IP address from a host name like so:
    vb.net Code:
    1. Private Function GetIPAddressFromHostName(ByVal hostName As String) As String
    2.     Return Dns.GetHostEntry(hostName).AddressList(0).ToString()
    3. End Function
    I thought that the other way was similar but it failed in my testing. If I have a chance I'll look further, but someone else may know in the mean time.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width