大洲
要从七大洲中获取代理,请在授权字符串中添加 continent 参数和两个字母的代码。可选择的大洲列表及相应的字母代码如下:
continent-AF 代表非洲
continent-AN 代表南极洲
continent-AS 代表亚洲
continent-EU 代表欧洲
continent-NA 代表北美洲
continent-OC 代表大洋洲
continent-SA 代表南美洲
代码示例:
在此示例中,从亚洲的随机 IP 地址对 ipinfo.ipidea.com 进行查询
curl -x "https://td-customer-USERNAME-continent-as:[email protected]:9999" "https://ipinfo.ipidea.com"using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class csharp_http
{
static void Main(string[] args)
{
Task t = new Task(DownloadPageAsync);
t.Start();
Console.ReadLine();
}
static async void DownloadPageAsync()
{
string page = "https://ipinfo.ipidea.com";
var proxy = new WebProxy("http://t.ipidea.online:9999")
{
UseDefaultCredentials = false,
Credentials = new NetworkCredential(
userName: "td-customer-USERNAME-continent-as",
password: "PASSWORD")
};
var httpClientHandler = new HttpClientHandler()
{
Proxy = proxy,
};
var client = new HttpClient(handler: httpClientHandler, disposeHandler: true);
var response = await client.GetAsync(page);
using (HttpContent content = response.Content)
{
string result = await content.ReadAsStringAsync();
Console.WriteLine(result);
Console.WriteLine("Press any key to exit.");
Console.ReadKey();
}
}
}最后更新于