What is the difference between Request.ServerVariables[“REMOTE_ADDR”] and Request.UserHostAddress?

喜夏-厌秋 提交于 2019-12-08 19:39:51

问题


What is the difference between Request.ServerVariables["REMOTE_ADDR"] and Request.UserHostAddress?

Are either of these variables considered unreliable with respect to IP Address spoofing?


回答1:


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.




回答2:


They are the same, ServerVariables["REMOTE_ADDR"] was provided only for backwards compatibility with older Classic Asp codebases. You should prefer using Request.UserHostAddress.



来源:https://stackoverflow.com/questions/6537482/what-is-the-difference-between-request-servervariablesremote-addr-and-reques

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!