I am trying to write a program that wil开发者_运维问答l tell my grandmother whether the internet is live or not. I know, I know, She just doesn't get it. So I want to create a program to load google.com or something and all I want the program to do is tell her whether the site was found or not. Is there a way to do this with the WebBrowser control?
I would really appreciate any help!
Thanks, Cecil
You should use the Ping
class.
Call Ping.Send("google.com")
and check whether Status
is Success
.
精彩评论