arun sahani

arun sahani

  • 0
  • 379
  • 0

Show Ping Status in list

Apr 24 2019 2:05 AM
Hi,
Using Asp.net mvc5, I have table with fields like "id", and "server_IP" populated with n-numbers of server ip. And wants to display the status of each IP " success" or "timeout" depending upon ping.
 
I have used  following;
 
Ping myPing = new Ping();
PingReply reply = myPing.Send("8.8.8.8", 1000);
if (reply != null)
{
ViewData["ip_stat"] = reply.Status;
 
I could not use this in my viewlist so that status of each servers can be shown as 
 
Server_ip     status
8.8.8.8     Success
 192.168.10.10 timeout 
 192.168.100.1  sucess
 
REGARDS
ARUN SAHANI 

Answers (1)