‘url=”www.baidu.com”
url=”119.75.217.109″
strComputer=”.”
Set objWMIService=GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & strComputer & “\root\cimv2”)
Set colPings=objWMIService.ExecQuery (“Select * From Win32_PingStatus where Address='” & url & “‘”)
For Each objPing in colPings
MsgBox url & ” responded to ping.” & vbcrlf &_
“Responding Address: ” & objPing.ProtocolAddress & vbcrlf &_
“Responding Name: ” & objPing.ProtocolAddressResolved & vbcrlf &_
“Bytes Sent: ” & objPing.BufferSize & vbcrlf &_
“Time: ” & objPing.ResponseTime & ” ms”
Next
‘url=”www.baidu.com”
url=”119.75.217.109″
strComputer=”.”
Set objWMIService=GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & strComputer & “\root\cimv2”)
Set colPings=objWMIService.ExecQuery (“Select * From Win32_PingStatus where Address='” & url & “‘”)
For Each objPing in colPings
MsgBox url & ” responded to ping.” & vbcrlf &_
“Responding Address: ” & objPing.ProtocolAddress & vbcrlf &_
“Responding Name: ” & objPing.ProtocolAddressResolved & vbcrlf &_
“Bytes Sent: ” & objPing.BufferSize & vbcrlf &_
“Time: ” & objPing.ResponseTime & ” ms”
Next
© 版权声明
文章版权归作者所有,未经允许请勿转载。