Horje
check ping c sharp Code Example
check ping c sharp
using System.Net.NetworkInformation;    

public static bool PingHost(string nameOrAddress)
{
    bool pingable = false;
    Ping pinger = null;

    try
    {
        pinger = new Ping();
        PingReply reply = pinger.Send(nameOrAddress);
        pingable = reply.Status == IPStatus.Success;
    }
    catch (PingException)
    {
        // Discard PingExceptions and return false;
    }
    finally
    {
        if (pinger != null)
        {
            pinger.Dispose();
        }
    }

    return pingable;
}




Csharp

Related
how to destroy an object in unity Code Example how to destroy an object in unity Code Example
c# remove all null from list Code Example c# remove all null from list Code Example
regex for email c# Code Example regex for email c# Code Example
get text between two strings c# Code Example get text between two strings c# Code Example
how to change a image with code unity Code Example how to change a image with code unity Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12