Skip to content

Latest commit

 

History

History
19 lines (17 loc) · 619 Bytes

File metadata and controls

19 lines (17 loc) · 619 Bytes

Router.Device.Net

Use the UPNP discovery protocol to obtain the external IP address of the network router

examples

using Router.Device.Net;

Console.WriteLine("Hello, World!");
var routers = RouterDeviceNet.FindRouters("以太网").Result;
foreach (var router in routers)
{
    var ip = router.GetExternalIPAddress().Result;
    Console.WriteLine("==============================================");
    Console.WriteLine($"DeviceName:{router.friendlyName}");
    Console.WriteLine($" DeviceUrl:{router.presentationURL.Trim()}");
    Console.WriteLine($" IPAddress:{ip}");
}
Console.ReadLine();