Skip to content

Commit c4c607b

Browse files
committed
Update README.md
1 parent 7ba4374 commit c4c607b

File tree

1 file changed

+2
-194
lines changed

1 file changed

+2
-194
lines changed

README.md

Lines changed: 2 additions & 194 deletions
Original file line numberDiff line numberDiff line change
@@ -5,200 +5,8 @@ This component allows user to query an IP address if it was being used as VPN an
55
* Free IP2Proxy BIN Data: https://lite.ip2location.com
66
* Commercial IP2Proxy BIN Data: https://www.ip2location.com/database/ip2proxy
77

8-
As an alternative, this component can also call the IP2Proxy Web Service. This requires an API key. If you don't have an existing API key, you can subscribe for one at the below:
9-
10-
https://www.ip2location.com/web-service/ip2proxy
11-
12-
## Requirements
13-
14-
Microsoft .NET 4.72 framework or later.
15-
Compatible with .NET Core 2.x/3.x SDK.
16-
Compatible with .NET 5/6/7.
17-
18-
## QUERY USING THE BIN FILE
19-
20-
## Methods
21-
Below are the methods supported in this class.
22-
23-
|Method Name|Description|
24-
|---|---|
25-
|Open|Open the IP2Proxy BIN data for lookup. Please see the **Usage** section of the 2 modes supported to load the BIN data file.|
26-
|Close|Close and clean up the file pointer.|
27-
|GetPackageVersion|Get the package version (1 to 11 for PX1 to PX11 respectively).|
28-
|GetModuleVersion|Get the module version.|
29-
|GetDatabaseVersion|Get the database version.|
30-
|IsProxy|Check whether if an IP address was a proxy. Returned value:<ul><li>-1 : errors</li><li>0 : not a proxy</li><li>1 : a proxy</li><li>2 : a data center IP address or search engine robot</li></ul>|
31-
|GetAll|Return the proxy information in an object.|
32-
|GetProxyType|Return the proxy type. Please visit <a href="https://www.ip2location.com/database/px10-ip-proxytype-country-region-city-isp-domain-usagetype-asn-lastseen-threat-residential" target="_blank">IP2Location</a> for the list of proxy types supported|
33-
|GetCountryShort|Return the ISO3166-1 country code (2-digits) of the proxy.|
34-
|GetCountryLong|Return the ISO3166-1 country name of the proxy.|
35-
|GetRegion|Return the ISO3166-2 region name of the proxy. Please visit <a href="https://www.ip2location.com/free/iso3166-2" target="_blank">ISO3166-2 Subdivision Code</a> for the information of ISO3166-2 supported|
36-
|GetCity|Return the city name of the proxy.|
37-
|GetISP|Return the ISP name of the proxy.|
38-
|GetDomain|Return the domain name of the proxy.|
39-
|GetUsageType|Return the usage type classification of the proxy. Please visit <a href="https://www.ip2location.com/database/px10-ip-proxytype-country-region-city-isp-domain-usagetype-asn-lastseen-threat-residential" target="_blank">IP2Location</a> for the list of usage types supported.|
40-
|GetASN|Return the autonomous system number of the proxy.|
41-
|GetAS|Return the autonomous system name of the proxy.|
42-
|GetLastSeen|Return the number of days that the proxy was last seen.|
43-
|GetThreat|Return the threat type of the proxy.|
44-
|GetProvider|Return the provider of the proxy.|
45-
46-
## Usage
47-
48-
Open and read IP2Proxy binary database. There are 2 modes:
49-
50-
1. **IOModes.IP2PROXY_FILE_IO** - File I/O reading. Slower lookup, but low resource consuming. This is the default.
51-
2. **IOModes.IP2PROXY_MEMORY_MAPPED** - Stores whole IP2Proxy database into a memory-mapped file. Extremely resources consuming. Do not use this mode if your system do not have enough memory.
52-
53-
```vb.net
54-
Dim proxy As New IP2Proxy.Component
55-
Dim all As IP2Proxy.ProxyResult
56-
57-
Dim isproxy As Integer
58-
Dim proxytype As String
59-
Dim countryshort As String
60-
Dim countrylong As String
61-
Dim region As String
62-
Dim city As String
63-
Dim isp As String
64-
Dim domain As String
65-
Dim usagetype As String
66-
Dim asn As String
67-
Dim [as] As String
68-
Dim lastseen As String
69-
Dim threat As String
70-
Dim provider As String
71-
72-
Dim ip As String = "221.121.146.0"
73-
74-
If proxy.Open("C:\data\IP2PROXY-IP-PROXYTYPE-COUNTRY-REGION-CITY-ISP-DOMAIN-USAGETYPE-ASN-LASTSEEN-THREAT-RESIDENTIAL-PROVIDER.BIN", IP2Proxy.Component.IOModes.IP2PROXY_MEMORY_MAPPED) = 0 Then
75-
Console.WriteLine("GetModuleVersion: " & proxy.GetModuleVersion())
76-
Console.WriteLine("GetPackageVersion: " & proxy.GetPackageVersion())
77-
Console.WriteLine("GetDatabaseVersion: " & proxy.GetDatabaseVersion())
78-
79-
' reading all available fields
80-
all = proxy.GetAll(ip)
81-
Console.WriteLine("Is_Proxy: " & all.Is_Proxy.ToString())
82-
Console.WriteLine("Proxy_Type: " & all.Proxy_Type)
83-
Console.WriteLine("Country_Short: " & all.Country_Short)
84-
Console.WriteLine("Country_Long: " & all.Country_Long)
85-
Console.WriteLine("Region: " & all.Region)
86-
Console.WriteLine("City: " & all.City)
87-
Console.WriteLine("ISP: " & all.ISP)
88-
Console.WriteLine("Domain: " & all.Domain)
89-
Console.WriteLine("Usage_Type: " & all.Usage_Type)
90-
Console.WriteLine("ASN: " & all.ASN)
91-
Console.WriteLine("AS: " & all.AS)
92-
Console.WriteLine("Last_Seen: " & all.Last_Seen)
93-
Console.WriteLine("Threat: " & all.Threat)
94-
Console.WriteLine("Provider: " & all.Provider)
95-
96-
' reading individual fields
97-
isproxy = proxy.IsProxy(ip)
98-
Console.WriteLine("Is_Proxy: " & isproxy.ToString())
99-
100-
proxytype = proxy.GetProxyType(ip)
101-
Console.WriteLine("Proxy_Type: " & proxytype)
102-
103-
countryshort = proxy.GetCountryShort(ip)
104-
Console.WriteLine("Country_Short: " & countryshort)
105-
106-
countrylong = proxy.GetCountryLong(ip)
107-
Console.WriteLine("Country_Long: " & countrylong)
108-
109-
region = proxy.GetRegion(ip)
110-
Console.WriteLine("Region: " & region)
111-
112-
city = proxy.GetCity(ip)
113-
Console.WriteLine("City: " & city)
114-
115-
isp = proxy.GetISP(ip)
116-
Console.WriteLine("ISP: " & isp)
117-
118-
domain = proxy.GetDomain(ip)
119-
Console.WriteLine("Domain: " & domain)
120-
121-
usagetype = proxy.GetUsageType(ip)
122-
Console.WriteLine("Usage_Type: " & usagetype)
123-
124-
asn = proxy.GetASN(ip)
125-
Console.WriteLine("ASN: " & asn)
126-
127-
[as] = proxy.GetAS(ip)
128-
Console.WriteLine("AS: " & [as])
129-
130-
lastseen = proxy.GetLastSeen(ip)
131-
Console.WriteLine("Last_Seen: " & lastseen)
132-
133-
threat = proxy.GetThreat(ip)
134-
Console.WriteLine("Threat: " & threat)
135-
136-
provider = proxy.GetProvider(ip)
137-
Console.WriteLine("Provider: " & provider)
138-
Else
139-
Console.WriteLine("Error reading BIN file.")
140-
End If
141-
proxy.Close()
142-
143-
```
144-
145-
## QUERY USING THE IP2PROXY PROXY DETECTION WEB SERVICE
146-
147-
## Methods
148-
Below are the methods supported in this class.
149-
150-
|Method Name|Description|
151-
|---|---|
152-
|Open(ByVal APIKey As String, ByVal Package As String, ByVal Optional UseSSL As Boolean = True)| Expects 2 or 3 input parameters:<ol><li>IP2Proxy API Key.</li><li>Package (PX1 - PX11)</li></li><li>Use HTTPS or HTTP</li></ol> |
153-
|IPQuery(ByVal IP As String)|Query IP address. This method returns a JObject containing the proxy info. <ul><li>countryCode</li><li>countryName</li><li>regionName</li><li>cityName</li><li>isp</li><li>domain</li><li>usageType</li><li>asn</li><li>as</li><li>lastSeen</li><li>threat</li><li>proxyType</li><li>isProxy</li><li>provider</li><ul>|
154-
|GetCredit()|This method returns the web service credit balance in a JObject.|
155-
156-
## Usage
157-
158-
```vb.net
159-
Imports System.IO
160-
161-
Module TestIP2Proxy
162-
163-
Sub Main()
164-
Dim proxyws As New IP2Proxy.ComponentWebService()
165-
Dim ip = "221.121.146.0"
166-
Dim apikey = "YOUR_API_KEY"
167-
Dim package = "PX11"
168-
Dim ssl = True
169-
170-
proxyws.Open(apikey, package, ssl)
171-
Dim myresult = proxyws.IPQuery(ip)
172-
173-
If myresult.ContainsKey("response") Then
174-
If myresult("response").ToString <> "OK" Then
175-
Console.WriteLine("Error: " & myresult("response").ToString)
176-
Else
177-
Console.WriteLine("countryCode: " & If(myresult.ContainsKey("countryCode"), myresult("countryCode").ToString, ""))
178-
Console.WriteLine("countryName: " & If(myresult.ContainsKey("countryName"), myresult("countryName").ToString, ""))
179-
Console.WriteLine("regionName: " & If(myresult.ContainsKey("regionName"), myresult("regionName").ToString, ""))
180-
Console.WriteLine("cityName: " & If(myresult.ContainsKey("cityName"), myresult("cityName").ToString, ""))
181-
Console.WriteLine("isp: " & If(myresult.ContainsKey("isp"), myresult("isp").ToString, ""))
182-
Console.WriteLine("domain: " & If(myresult.ContainsKey("domain"), myresult("domain").ToString, ""))
183-
Console.WriteLine("usageType: " & If(myresult.ContainsKey("usageType"), myresult("usageType").ToString, ""))
184-
Console.WriteLine("asn: " & If(myresult.ContainsKey("asn"), myresult("asn").ToString, ""))
185-
Console.WriteLine("as: " & If(myresult.ContainsKey("as"), myresult("as").ToString, ""))
186-
Console.WriteLine("lastSeen: " & If(myresult.ContainsKey("lastSeen"), myresult("lastSeen").ToString, ""))
187-
Console.WriteLine("proxyType: " & If(myresult.ContainsKey("proxyType"), myresult("proxyType").ToString, ""))
188-
Console.WriteLine("threat: " & If(myresult.ContainsKey("threat"), myresult("threat").ToString, ""))
189-
Console.WriteLine("isProxy: " & If(myresult.ContainsKey("isProxy"), myresult("isProxy").ToString, ""))
190-
Console.WriteLine("provider: " & If(myresult.ContainsKey("provider"), myresult("provider").ToString, ""))
191-
End If
192-
End If
193-
194-
myresult = proxyws.GetCredit()
195-
If myresult.ContainsKey("response") Then
196-
Console.WriteLine("Credit balance: " & If(myresult.ContainsKey("response"), myresult("response").ToString, ""))
197-
End If
198-
End Sub
199-
200-
End Module
201-
```
8+
## Developer Documentation
9+
To learn more about installation, usage, and code examples, please visit the developer documentation at [https://ip2proxy-dotnet.readthedocs.io/en/latest/index.html.](https://ip2proxy-dotnet.readthedocs.io/en/latest/index.html)
20210

20311
### Proxy Type
20412

0 commit comments

Comments
 (0)