hello guys! how can i ping a particular website? becuase i think Ping class from System.Net.Networkinformation is not designed tp ping Uri but im not sure. any help please.
Printable View
hello guys! how can i ping a particular website? becuase i think Ping class from System.Net.Networkinformation is not designed tp ping Uri but im not sure. any help please.
You don't ping a URL. You ping a machine, hence the fact that you specify an IP address. What exactly is it that you want to know? Whether a particular Web page address is valid? If so then I would guess that WebClient.OpenRead would do the job. I'm not sure but I would expect that it would either throw an exception or return a null reference if the address was not valid.
What if the Machine is up/powered on but the Web Service (IIS) is not available? what im trying to do is to check whether the website is available or not. i'll Webclient.OpenRead. Thanks for that anyway.
Use the HttpWebRequest/WebRequest class to make a call to the URL of the machine or IP address. Then look at the reply.