我觉得是服务器的问题了,只认32字节的包。用wmi试下看能解决你的需求不。__wmi_Win32_PingStatus("114.114.114.114")
Func __wmi_Win32_PingStatus($server)
Local $colItems = ""
Local $strComputer = "localhost"
Local $Output = ""
$Output &= "Computer: " & $strComputer & @CRLF
$Output &= "==========================================" & @CRLF
Local $objWMIService = ObjGet("winmgmts:\" & $strComputer & "\ROOT\CIMV2")
$colItems = $objWMIService.ExecQuery("select * from Win32_PingStatus where address ='" & $server & "'")
If IsObj($colItems) Then
For $objItem In $colItems
$Output &= "Address: " & $objItem.Address & @CRLF
$Output &= "BufferSize: " & $objItem.BufferSize & @CRLF
$Output &= "NoFragmentation: " & $objItem.NoFragmentation & @CRLF
$Output &= "PrimaryAddressResolutionStatus: " & $objItem.PrimaryAddressResolutionStatus & @CRLF
$Output &= "ProtocolAddress: " & $objItem.ProtocolAddress & @CRLF
$Output &= "ProtocolAddressResolved: " & $objItem.ProtocolAddressResolved & @CRLF
$Output &= "RecordRoute: " & $objItem.RecordRoute & @CRLF
$Output &= "ReplyInconsistency: " & $objItem.ReplyInconsistency & @CRLF
$Output &= "ReplySize: " & $objItem.ReplySize & @CRLF
$Output &= "ResolveAddressNames: " & $objItem.ResolveAddressNames & @CRLF
$Output &= "ResponseTime: " & $objItem.ResponseTime & @CRLF
$Output &= "ResponseTimeToLive: " & $objItem.ResponseTimeToLive & @CRLF
Local $strRouteRecord = $objItem.RouteRecord(0)
$Output &= "RouteRecord: " & $strRouteRecord & @CRLF
Local $strRouteRecordResolved = $objItem.RouteRecordResolved(0)
$Output &= "RouteRecordResolved: " & $strRouteRecordResolved & @CRLF
$Output &= "SourceRoute: " & $objItem.SourceRoute & @CRLF
$Output &= "SourceRouteType: " & $objItem.SourceRouteType & @CRLF
$Output &= "StatusCode: " & $objItem.StatusCode & @CRLF
$Output &= "Timeout: " & $objItem.Timeout & @CRLF
Local $strTimeStampRecord = $objItem.TimeStampRecord(0)
$Output &= "TimeStampRecord: " & $strTimeStampRecord & @CRLF
Local $strTimeStampRecordAddress = $objItem.TimeStampRecordAddress(0)
$Output &= "TimeStampRecordAddress: " & $strTimeStampRecordAddress & @CRLF
Local $strTimeStampRecordAddressResolved = $objItem.TimeStampRecordAddressResolved(0)
$Output &= "TimeStampRecordAddressResolved: " & $strTimeStampRecordAddressResolved & @CRLF
$Output &= "TimestampRoute: " & $objItem.TimestampRoute & @CRLF
$Output &= "TimeToLive: " & $objItem.TimeToLive & @CRLF
$Output &= "TypeofService: " & $objItem.TypeofService & @CRLF
If MsgBox(1, "WMI Output", $Output) = 2 Then ExitLoop
$Output = ""
Next
Else
MsgBox(0, "WMI 输出", "没有在类 " & "Win32_PingStatus" & "中找到WMI对象")
EndIf
EndFunc ;==>__wmi_Win32_PingStatus
|