以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  判断网络通否  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=6184)

--  作者:lpxjw_zyl
--  发布时间:2010/3/15 8:45:00
--  判断网络通否
怎样判断网络连接是否连接。
--  作者:lpxjw_zyl
--  发布时间:2010/3/15 9:07:00
--  

老六你帮我解决一下


--  作者:yangming
--  发布时间:2010/3/15 9:42:00
--  

Ping

对指定服务器执行Ping操作。

语法:

Ping(address)
Ping(address ,timeout)

address:要ping的域名或者IP地址,域名前面不能有"http://"
timeout:可选参数,在Ping通之前持续尝试的时间,单位为毫秒,默认值为500。

如果Ping通,则返回True,否则返回False

示例:

If Network.Ping("www.egridsoft.com") Then
    Messagebox.Show(
"可以访问易表主页")

End If
If
Network.Ping("198.01.01.01") Then
    Messagebox.Show(
"该服务器可用")

End If


--  作者:lxl
--  发布时间:2010/3/15 9:43:00
--  
If My.Computer.Network.IsAvailable Then
    MessageBox.Show("网络正常!")
Else
    MessageBox.Show("网络异常!")
End If