得到客户端真实 IP (c#)

    protected void Page_Load(object sender, EventArgs e)
    {
        string ip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (string.IsNullOrEmpty(a))
        {
            ip = Request.ServerVariables["REMOTE_ADDR"];
        }
    }
原文地址:https://www.cnblogs.com/xianzuoqiaoqi/p/1514172.html