Tech Support Guy banner
Status
Not open for further replies.

Ping URL

700 views 3 replies 2 participants last post by  Brightstar5 
#1 ·
I have to create a console based application: when RUN> takes the websites I specify and pings them all 4 times and gets the ping in milliseconds then finally saves all of the information in a .csv file. Please Help me.
 
#4 ·
this is what I have so far...I need to be able to atleast ping 3 more websites:
using System.IO;
using System.Linq;
using System.Net;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

namespace Ping Application
{
public class PingExample
{
static void Main(string[] args)
{
try
{
Ping myPing = new Ping();
PingReply reply = myPing.Send("www.yahoo.com", 1000);
if (reply != null)
//Append to a file called Ping URL LOG
{
Console.WriteLine("Status: " + reply.Status + ", Time: " + reply.RoundtripTime.ToString() + ", Address: " + reply.Address);
}
}
catch
{
Console.WriteLine.("ERROR: You have some TIMEOUT issue");
}
Console.ReadKey();
}
}
}
 
Status
Not open for further replies.
You have insufficient privileges to reply here.
Top