zoukankan      html  css  js  c++  java
  • 穿过代理服务器取远程用户真实IP地址

    1. public static string GetIP()  
    2.       {  
    3.           string str = "";  
    4.           //穿过代理服务器取远程用户真实IP地址:  
    5.           if (System.Web.HttpContext.Current.Request.ServerVariables["HTTP_VIA"] != null)  
    6.           {  
    7.               str = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();  
    8.           }  
    9.           else  
    10.           {  
    11.               str = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString();  
    12.           }  
    13.           return str;  
    14.       }  
  • 相关阅读:
    python10.31
    python10.29
    python10.28
    python10.27
    python10.25
    python10.24
    python10.23
    四边形不等式与决策单调
    0x57~0x59
    0x55~0x56
  • 原文地址:https://www.cnblogs.com/telwanggs/p/6477560.html
Copyright © 2011-2022 走看看