CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2012
    Posts
    1

    Help Parsing String into an ip address

    So im trying to parse a string into a Ip Address but i have a problem, the IPAddress.Parse method only works for ipv4 address's how do i parse ANY Ip address into a string, if i use the IPaddress.Parse method on my public(remote) IP it throws an exception but on ipv4 local ip's it doesn't, how do i parse ANY ip address the user inputs as a string as an Ip Address? and allow the socket to bind to it? Sometimes parsing it works but the socket says invalid ip when on the socket.bind() call, Please help!

  2. #2
    Join Date
    Jul 2012
    Posts
    90

    Re: Help Parsing String into an ip address

    The IPAddress.Parse static method will handle IPv6 addresses (I checked MSDN for .Net 1.1, 2.0. 3.0, 3.5, 4.0, and 4.5). Post the exception you are getting.

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

Featured