Answers for "check connection c#"

C#
3

check connection c#

public static bool CheckForInternetConnection()
{
    try
    {
        using (var client = new WebClient())
            using (client.OpenRead("http://google.com/generate_204")) 
                return true; 
    }
    catch
    {
        return false;
    }
}
Posted by: Guest on June-12-2020

C# Answers by Framework

Browse Popular Code Answers by Language