Esempio n. 1
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");
     }
 }