public void GetGeoIPTest() { var ipInformation = new GeoIP(); Assert.IsNotNull(ipInformation.City); Assert.IsNotNull(ipInformation.Country); Assert.IsNotNull(ipInformation.CountryCode); Assert.IsNotNull(ipInformation.Region); Assert.IsNotNull(ipInformation.WanIp); }
public static void InitializeGeoIp() { GeoIP gIp = new GeoIP(); Country = gIp.Country; CountryCode = gIp.CountryCode; Region = gIp.Region; City = gIp.City; WanIp = gIp.WanIp; if (CountryCode == "-" || Country == "Unknown") { ImageIndex = 247; // question icon return; } for (int i = 0; i < ImageList.Length; i++) { if (ImageList[i].Contains(CountryCode.ToLower())) { ImageIndex = i; break; } } }