Ping class not available in UWP

I think this is a simple problem. I have an IP address and I want to download it and get its duration. However, there is no class in UWP Ping.

How to ping IP without this class? Should I connect to a specific port?

+4
source share
2 answers

Add the System.Net.Ping NuGet package to the project

+2
source

try ping port 80. Usually this is the port you should use if you pinged a website.

try the following:

            HostName host = new HostName("www.google.com");
            var eps = await DatagramSocket.GetEndpointPairsAsync(host , "80");
            if(eps.Count >= 1)
            {
                return true;
            }
            else
            {
                return false;
            }
+1
source

All Articles