What is the difference between Request.ServerVariables["REMOTE_ADDR"]
and Request.UserHostAddress
?
Request.ServerVariables [“REMOTE_ADDR”]和Request.UserHostAddress有什么区别?
Are either of these variables considered unreliable with respect to IP Address spoofing?
在IP地址欺骗方面,这些变量中的任何一个都被认为是不可靠的吗?
2 个解决方案
#1
6
The .ServerVariables is provided for compatibility with the old ASP method for getting that information. Most of the information provided through that is now provided through separate properties.
提供.ServerVariables是为了与旧的ASP方法兼容以获取该信息。通过它提供的大多数信息现在通过单独的属性提供。
#2
6
They are the same, ServerVariables["REMOTE_ADDR"]
was provided only for backwards compatibility with older Classic Asp codebases. You should prefer using Request.UserHostAddress
.
它们是相同的,ServerVariables [“REMOTE_ADDR”]仅用于向后兼容较旧的Classic Asp代码库。您应该更喜欢使用Request.UserHostAddress。
#1
6
The .ServerVariables is provided for compatibility with the old ASP method for getting that information. Most of the information provided through that is now provided through separate properties.
提供.ServerVariables是为了与旧的ASP方法兼容以获取该信息。通过它提供的大多数信息现在通过单独的属性提供。
#2
6
They are the same, ServerVariables["REMOTE_ADDR"]
was provided only for backwards compatibility with older Classic Asp codebases. You should prefer using Request.UserHostAddress
.
它们是相同的,ServerVariables [“REMOTE_ADDR”]仅用于向后兼容较旧的Classic Asp代码库。您应该更喜欢使用Request.UserHostAddress。