コード例 #1
0
 public static string GetIP()
 {
     try
     {
         string empty = string.Empty;
         empty = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
         if (empty == null || empty == string.Empty)
         {
             empty = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
         }
         if (empty == null || empty == string.Empty)
         {
             empty = HttpContext.Current.Request.UserHostAddress;
         }
         if (empty == null || empty == string.Empty || !FPUtils.IsIP(empty))
         {
             return("0.0.0.0");
         }
         return(empty);
     }
     catch
     {
         return("0.0.0.0");
     }
 }
コード例 #2
0
        // Token: 0x060000A4 RID: 164 RVA: 0x00009630 File Offset: 0x00007830
        public static string GetIP()
        {
            string result;

            try
            {
                string text = string.Empty;
                text = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
                if (text == null || text == string.Empty)
                {
                    text = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
                }
                if (text == null || text == string.Empty)
                {
                    text = HttpContext.Current.Request.UserHostAddress;
                }
                if (text == null || text == string.Empty || !FPUtils.IsIP(text))
                {
                    result = "0.0.0.0";
                }
                else
                {
                    result = text;
                }
            }
            catch
            {
                result = "0.0.0.0";
            }
            return(result);
        }
コード例 #3
0
 public static string GetServerIP()
 {
     try
     {
         string empty = string.Empty;
         empty = HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"];
         if (empty == null || empty == string.Empty || !FPUtils.IsIP(empty))
         {
             return("0.0.0.0");
         }
         if (empty == "127.0.0.1" || empty == "0.0.0.0")
         {
             empty = FPUtils.GetIntranetIp();
         }
         return(empty);
     }
     catch
     {
         return("0.0.0.0");
     }
 }
コード例 #4
0
        // Token: 0x060000A5 RID: 165 RVA: 0x00009708 File Offset: 0x00007908
        public static string GetServerIP()
        {
            string result;

            try
            {
                string text = string.Empty;
                text = HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"];
                if (text == null || text == string.Empty || !FPUtils.IsIP(text))
                {
                    result = "0.0.0.0";
                }
                else
                {
                    result = text;
                }
            }
            catch
            {
                result = "0.0.0.0";
            }
            return(result);
        }