views:

69

answers:

2

Hi, I have a problem when I use HttpContext.Current.Request.UserHostAddress, some times returns "192.168.0.17" (IPv4) and some times returns "fe80::99be:a05d:7938:1c30%8" (IPv6), calling from the same computer and navigator.

What I do to return always IPv4?

+3  A: 

Found a solution that somebody hacked up. Can't say if it'll work, tho =)

http://www.eggheadcafe.com/software/aspnet/30078410/request-object.aspx

David Hedlund
Thank you for solution. +1
Cesar
Beat me with a virtually identical solution by mere seconds. +1
md5sum
@md5sum: well the good news, then, is none of us deserves the creds for the actual code ;)
David Hedlund
@d. too true! Funny how much recycling you can do with code.
md5sum
+2  A: 

Check out this post on 4GuysFromRolla and see if it helps at all. I think this is the information you're looking for.

http://aspnet.4guysfromrolla.com/articles/071807-1.aspx

~md5sum~

md5sum