-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0abdfb
commit c6b5f50
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Net.NetworkInformation; | ||
|
||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
string host = "http://locahost:3000"; // replace with the hostname or IP address to ping | ||
|
||
Ping ping = new Ping(); | ||
PingReply reply = ping.Send(host); | ||
|
||
if (reply.Status == IPStatus.Success) | ||
{ | ||
Console.WriteLine("Ping to {0} successful. Time: {1}ms", host, reply.RoundtripTime); | ||
} | ||
else | ||
{ | ||
Console.WriteLine("Ping to {0} failed. Status: {1}", host, reply.Status); | ||
} | ||
|
||
Console.ReadKey(); | ||
} | ||
} |