string ipaddress; System.Web.HttpRequest Request; ipaddress =Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (ipaddress == "" || ipaddress == null) ipaddress = Request.ServerVariables["REMOTE_ADDR"]; DataTable dt = GetLocation(ipaddress); if (dt != null) { if (dt.Rows.Count > 0) { city = dt.Rows[0]["City"].ToString(); RegionName = dt.Rows[0]["RegionName"].ToString(); CountryName = dt.Rows[0]["CountryName"].ToString(); CountryCode = dt.Rows[0]["CountryCode"].ToString(); } else { } }
System.Web.HttpRequest Request; ipaddress =Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
Request
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)