How to create a simple ping to website and get is online or not?
Ex:
var test = new ping()
try{
test.ping(www.google.com)
messagebox.show("your internet connection is ok");
}
catch
{
messagebox.show("you are not connected");
}
it is possible? i have searched on the web but not found nothing
Use the
WebRequestclass to make an HTTP request and see if it succeeds.Note that ‘ping’ is really an ICMP function, and not what you’re looking for, if you’re testing websites (HTTP). If you really do want to just see if you have a connection, then ping will work, and the
Pingclass, as squiguy mentioned.