ping with c#
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;
}
Also in C#:
- unity rotate object relative to camera
- display none asp.net
- go to next itiration in foreach C#
- There is already an open DataReader associated with this Command which must be closed first c#
- .net core copy file in folder to root
- c# auto property set default value
- message uwp c#
- c# typeof
- c# empty array
- how to switch scenes unity
- load scene unity
- c# initialize empty array
- : ? conditioanl statement c#
- C# type cast float to string
- print line in python
- c sharp add item to dictionary
- unity calculate path
- c# contextswitchdeadlock
- Generate Genealogy view in mvc C# using Google Organizational Chart
- how to make error sound c#
- c# date
- c# how to convert string to int
- c# throw new exception
- string format c#