-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathProgram.cs
53 lines (36 loc) · 1.38 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System.Net;
using System.Threading.Tasks;
using WhatIsMyIPAddress.API;
namespace WhatIsMyIPAddress.Example
{
class Program
{
static void Main(string[] args)
{
//Synchronous Test
Test();
//Asynchronous Test
//TestAsync().Wait();
}
private static void Test()
{
var client = new Client(/*new WebProxy("169.57.1.84:8080")*/);
var ip = client.GetMyIPAddress();
var details = client.LookupIP(ip);
var proxy = client.ProxyCheck(new WebProxy("138.68.240.218:8080")).IsProxyServer;
var blacklist = client.BlacklistCheck(ip);
var hostname = client.LookupHostname(ip);
var resultIPs = client.LookupIPAddress("www.yahoo.com");
}
private async static Task TestAsync()
{
var client = new Client(/*new WebProxy("169.57.1.84:8080")*/);
var ip = await client.GetMyIPAddressAsync();
var details = await client.LookupIPAsync(ip);
var proxy = (await client.ProxyCheckAsync(new WebProxy("138.68.240.218:8080"))).IsProxyServer;
var blacklist = await client.BlacklistCheckAsync(ip);
var hostname = await client.LookupHostnameAsync(ip);
var resultIPs = await client.LookupIPAddressAsync("www.yahoo.com");
}
}
}