Nord Vpn Library for .NET , using for automation softwares
Json library , using for api
❗All api using in this project, i get it from sleeplessbeastie.eu
if you need update more feature, you can visit that page, and check that document !
- ✅ Create new Nordserver
RemoteNordServer nordServer = new RemoteNordServer();
- ⬇️ Get available countries
List<NordModel.CountrieModel> countries = nordServer.GetCountries();- ⬇️ Get available techonologies
List<NordModel.CountrieModel> countries = nordServer.GetTechnologies();| Parameter | Type | Description |
|---|---|---|
limit |
int |
Required. limit servers to get |
- Get servers by Recommendation
var servers = nordServer.GetServers(ServerContext.Filters.Recommendation(), 100);
//100 is limit Parametervar servers = nordServer.GetServers(ServerContext.Filters.Recommendation(), 100).SortBy(Func<>);
// Func is delegate method to sort servers
// example .SortBy(x => x.LoadPercent <= 40); // sort servers by LoadPercent <= 40%
//100 is limit Parameter- get servers by limit
var servers = nordServer.GetServers(1000);
/// 1000 is limit servers- get servers by country
Parameter
countryidis country id extract from nordServer.GetCountries();
var servers = nordServer.GetServers(ServerContext.Filters.ByCountry(countryid),100);
/// 1000 is limit servers
// example .GetServers(ServerContext.Filters.ByCountry("234"),100); // 234 is countryid of Vietnam- get servers by country
Parameter
identifier_nameis identifier_name , extract from nordServer.GetTechnologies() or nordServer.GetCountries(); , example : openvpn_udp
var servers = nordServer.GetServers(ServerContext.Filters.RecommendationBy("openvpn_udp"), 100);
/// 1000 is limit servers
/// openvpn_udp is identifier_name- ✅ Create new Nord Remote
Parameter
NordVpnFolderis NordVPN installed folder
RemoteNord nord = new RemoteNord(NordVpnFolder);
// example : NordVpnFolder is C:\Program Files\NordVPN is NordVPN folder- 🪢 Connect to server
Parameter
Serveris Server to connect , extract from GetServers method
var cn = nord.FindServerBy(servers[1]).Connect();- 🔃 Wait nord connect to server
Parameter
timeoutis time wait connect
NordModel.ConnectionInfo info = cn.WaitConnect(TimeSpan.FromSeconds(60)); // wait 1 minutesNordModel.ConnectionInfo info = nord.FindServerBy(servers[1]).Connect().WaitConnect(TimeSpan.FromSeconds(60));
// connect , then wait 1 minutes- ✅ Check ConnectionInfo
info.ElapsedTime is elapsed time to connect
info.Error is exception ( if connect error )
info.isConnected connect status ( bool ) , true is connect success , false is connect failed
- 🔴 Disconnect nord
nord.Dispose();if this project helpful you , you can donate me at :
2129296886 / TECHCOM BANK / NGUYEN DAC TAI
