How do I convert an IPv4 addres to IPv6 in C#?

  • Thread starter Thread starter Valerie Hough
  • Start date Start date
V

Valerie Hough

My app has so far only encountered IPv4 addresses and I use:
Dns.GetHostByName( "someOtherComputer", portNumber ).AddressList[0].

Can someone please point me to an example of how to turn this into an IPv6
address?

Thanks in advance.
Chris Hough
 
An IPv4 address is translated to an IPv6 address by placing the 4 octets of
the IPv4 address into the rightmost 4 octets of the IPv6 address.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
Forgot to mention: After inserting the 4 octets of the IPv4 address into the
rightmost 4 octets of the IPv6 address, the remaining left-most octets would
be 0 in value.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
Back
Top