IPAddress of a login system

前端 未结 6 2532
花落未央
花落未央 2020-12-22 05:42

Using the bellow code .

protected string GetUserIP()
{
    string strUserIP = string.Empty;
    if (HttpContext.Current.Request.ServerVariables[\"HTTP_X_FORW         


        
6条回答
  •  忘掉有多难
    2020-12-22 06:03

    It is of localhost ::1 if you use on web server you will get the correct one.

    Though it will depend on the configuration of the network from where the user is accessing your application.

    There can be firewall which doesn't expose the actual IP of the client system.

提交回复
热议问题