IP2Proxy .NET API#

Component Class#

Open(DatabasePath, IOMode)#

Load the IP2Proxy BIN database for lookup.

Parameters:
  • DatabasePath (String) – (Required) The file path links to IP2Proxy BIN databases.

  • IOMode (Enum) – (Optional) Specify which mode to use when loading the BIN database. Available values are IOModes.IP2PROXY_FILE_IO and IOModes.IP2PROXY_MEMORY_MAPPED. Default is IOModes.IP2PROXY_FILE_IO.

Open(DBStream)#

Initialize component with a stream that contains the BIN database then preload BIN file.

Parameters:

DBStream (Stream) – (Required) A stream that contains the BIN database.

Close()#

Close and clean up the file pointer.

GetPackageVersion()#

Return the database’s type, 1 to 11 respectively for PX1 to PX11. Please visit https://www.ip2location.com/databases/ip2proxy for details.

Returns:

Returns the package version.

Return type:

String

GetModuleVersion()#

Return the version of module.

Returns:

Returns the module version.

Return type:

String

GetDatabaseVersion()#

Return the database’s compilation date as a string of the form ‘YYYY-MM-DD’.

Returns:

Returns the database version.

Return type:

String

GetAll(IP)#

Retrieve geolocation information for an IP address.

Parameters:

IP (String) – (Required) The IP address (IPv4 or IPv6).

Returns:

Returns the geolocation information in array. Refer below table for the fields avaliable in the array

Return type:

array

RETURN FIELDS

Field Name

Description

Country_Short

Two-character country code based on ISO 3166.

Country_Long

Country name based on ISO 3166.

Region

Region or state name.

City

City name.

Isp

Internet Service Provider or company’s name.

Domain

Internet domain name associated with IP address range.

Usage_Type

Usage type classification of ISP or company.

Asn

Autonomous system number (ASN).

As

Autonomous system (AS) name.

Last_Seen

Proxy last seen in days.

Threat

Security threat reported.

Proxy_Type

Type of proxy.

Provider

Name of VPN provider if available.

GetAllAsync(IP)#

Retrieve geolocation information for an IP address.

Parameters:

IP (String) – (Required) The IP address (IPv4 or IPv6).

Returns:

Returns the geolocation information in array. Refer below table for the fields avaliable in the array

Return type:

array

RETURN FIELDS

Field Name

Description

Country_Short

Two-character country code based on ISO 3166.

Country_Long

Country name based on ISO 3166.

Region

Region or state name.

City

City name.

Isp

Internet Service Provider or company’s name.

Domain

Internet domain name associated with IP address range.

Usage_Type

Usage type classification of ISP or company.

Asn

Autonomous system number (ASN).

As

Autonomous system (AS) name.

Last_Seen

Proxy last seen in days.

Threat

Security threat reported.

Proxy_Type

Type of proxy.

Provider

Name of VPN provider if available.