Results 1 to 4 of 4

Thread: IPAddress Class [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Lively Member BradBrening's Avatar
    Join Date
    Oct 2001
    Location
    Gillespie, IL
    Posts
    102

    Question IPAddress Class [RESOLVED]

    In VB6, I used to be able to create an IP address string from a long value by using the following statement/API call:

    Code:
    lpStr = inet_ntoa(lngAddress)
    Then I would read the string from the pointer returned to get the IP address in dotted quad format.

    I am trying to port this to VB.NET using the following code:

    Code:
    Dim oIP As New IPAddress(lngAddress) 
    strData = oIP.ToString
    Usually this works, sometimes not. For example, if lngAddres = -156482353 (msn.com), I get the following exception: "Specified argument was out of the range of valid values."

    Anyone have any idea what I may be doing wrong? The old API way returned the proper value = 207.68.172.246.

    Brad
    Last edited by BradBrening; May 11th, 2005 at 01:09 PM. Reason: resolved

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