C# 클래스 MaxMind.GeoIPCountry

상속: IDisposable
파일 보기 프로젝트 열기: NyxStudios/TShock 1 사용 예제들

공개 메소드들

메소드 설명
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 ( IPAddress ip ) : string

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 ( IPAddress ip ) : string

Retrieves a two-letter code, defined by MaxMind, which details the country the specified IP address is located. Does not throw exceptions on failure.

비공개 메소드들

메소드 설명
AddressToLong ( IPAddress ip ) : long
FindCountryCode ( long offset, long ipnum, int depth ) : long
FindIndex ( IPAddress ip ) : int

메소드 상세

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

GeoIPCountry() 공개 메소드

Initialises a new instance of this class.
The stream is not closed when this class is disposed. Be sure to clean up afterwards!
public GeoIPCountry ( Stream datafile ) : System
datafile Stream An already open stream pointing to the contents of a GeoIP.dat file.
리턴 System

GeoIPCountry() 공개 메소드

Initialises a new instance of this class, using an on-disk database.
The file will be closed when this class is disposed.
public GeoIPCountry ( string filename ) : System
filename string Path to database file.
리턴 System

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.
public GetCountryCode ( IPAddress ip ) : string
ip System.Net.IPAddress IP address to query.
리턴 string

GetCountryNameByCode() 공개 정적인 메소드

Gets the English name of a country, by a country code.
public static GetCountryNameByCode ( string countrycode ) : string
countrycode string Country code to look up, returned by GetCountryCode or TryGetCountryCode.
리턴 string

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.
public TryGetCountryCode ( IPAddress ip ) : string
ip System.Net.IPAddress IP address to query.
리턴 string