本文介绍了Page.Request.UserHostAddress是格式无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时我的ASP.NET应用程序返回的值:: 1查询Page.Request.UserHostAddress时。

Sometimes my ASP.NET application returns a value of "::1" when querying Page.Request.UserHostAddress.

我看不到任何图案,当它返回一个正确的IP地址VS当它返回格式不正确的字符串。它将为半天工作,然后停了一个小时的工作只。有什么想法?

I can't see any pattern as to when it returns a correct IP address vs when it returns the incorrectly formatted string. It will work for half a day and then stop working for an hour randomly. Any thoughts?

编辑:

好吧,这回送地址IPv6的。 :)这导致了进一步的问题......当/为什么IPv6开一些场合,而不是别人?

Okay, it's the loopback address for IPv6. :) Which leads to the further question... When/why would IPv6 be used on some occasions and not others?

推荐答案

:: 1是IPv6的环回地址。相当于127.0.0.1 IPv4的。

::1 is the IPv6 loopback address. Equivalent to 127.0.0.1 for IPv4.

这篇关于Page.Request.UserHostAddress是格式无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 09:59