424,066 Members | 2,076 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,066 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Sep 26 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

"Valerie Hough" <sa***@pcTrans.comwrote in message
news:OP**************@TK2MSFTNGP06.phx.gbl...
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

Sep 26 '07 #2

P: n/a
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

"Valerie Hough" <sa***@pcTrans.comwrote in message
news:OP**************@TK2MSFTNGP06.phx.gbl...
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

Sep 26 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.