: I just wanted the C# code for continuously pinging the target system or if it is not possible to ping the target system continuously atleast the code in C# for pinging the target system.
Easiest way would to call ping.exe like this (didn't test it):
while (true)
{
System.Diagnostics.Process proc =
System.Diagnostics.Process.Start("ping.exe", "-n 1 www.domain.tld");
proc.WaitForExit();
if (proc.ExitCode != 0)
{
throw new Exception("Destination host unreachable");
}
}