What is the difference between Request.UserHostAddress and Request.ServerVariables[“REMOTE_ADDR”].ToString()

前端 未结 2 1319
执念已碎
执念已碎 2020-12-24 11:11

Here I can use either of these 2 methods. What are the differences and which one should I use?

Method 1:

    string srUserIp = \"\";         


        
2条回答
  •  生来不讨喜
    2020-12-24 11:58

    There is no difference. They return exactly the same value. However, one is IntelliSense-friendly whereas the other is not.

提交回复
热议问题