Method | Description | |
---|---|---|
Dispose ( ) : void | ||
GeoIPCountry ( Stream datafile ) : System |
Initialises a new instance of this class. The stream is not closed when this class is disposed. Be sure to clean up afterwards! |
|
GeoIPCountry ( string filename ) : System |
Initialises a new instance of this class, using an on-disk database. The file will be closed when this class is disposed. |
|
GetCountryCode ( |
Retrieves a two-letter code, defined by MaxMind, which details the country the specified IP address is located. The IP address must be IPv4. |
|
GetCountryNameByCode ( string countrycode ) : string |
Gets the English name of a country, by a country code.
|
|
TryGetCountryCode ( |
Retrieves a two-letter code, defined by MaxMind, which details the country the specified IP address is located. Does not throw exceptions on failure.
|
Method | Description | |
---|---|---|
AddressToLong ( |
||
FindCountryCode ( long offset, long ipnum, int depth ) : long | ||
FindIndex ( |
public GeoIPCountry ( Stream datafile ) : System | ||
datafile | Stream | An already open stream pointing to the contents of a GeoIP.dat file. |
return | System |
public GeoIPCountry ( string filename ) : System | ||
filename | string | Path to database file. |
return | System |
public GetCountryCode ( |
||
ip | IP address to query. | |
return | string |
public static GetCountryNameByCode ( string countrycode ) : string | ||
countrycode | string | Country code to look up, returned by GetCountryCode or TryGetCountryCode. |
return | string |
public TryGetCountryCode ( |
||
ip | IP address to query. | |
return | string |