- ©«¤l
- 14
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 50
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ©yÄõ
- µù¥U®É¶¡
- 2013-8-26
- ³Ì«áµn¿ý
- 2013-12-19
|
¥»©«³Ì«á¥Ñ linderlong ©ó 2013-8-28 08:59 ½s¿è
¦^´_ 2# c_c_lai
·PÁ¤j¤jªº«ü¾É¡I¤w¥i¥H¨Ï¥Î¡A¦ý³t«×¤W²¤¬°½wºC¡A¤£ª¾¦³µL¤èªk´£¤É´ú¸Õªº³t«×¡Aµ{¦¡¦p¤U¡G
°²³]a1¦Üa10Àx¦s®æ¤º®e¦U¬°100.18.22.1¦Ü100.18.22.10¡A¦b§Úªº¹q¸£¤W°õ¦æ§¹¤@¦¸¡An¶O®É45¬í¡A®É¶¡¤W¤Ó¤[¤F¡A¤£ª¾¦p¦óÁYµu®Éµ{¡HÁÂÁ¡I
Public Sub iptest()
Columns("B:B").Select
Selection.ClearContents
Range("A1").Select
¶O®É = Timer
i = 1
Do While Cells(i, 1) <> ""
Cells(i, 2) = Ping(Cells(i, 1))
i = i + 1
Loop
Cells(1, 3) = Timer - ¶O®É
End Sub
Private Function Ping(strAddr As String) As String
Dim strTmpFile As String
strTmpFile = Environ("TEMP") & "\PingResult.txt" ' ·Ç³Æ«Ø¼È¦sÀɦb Windows Temp ¥Ø¿ý¤U
CreateObject("WScript.Shell").Run Environ("COMSPEC") & " /c PING -n 1 " & strAddr & " > " & strTmpFile, 0, True
Ping = CreateObject("Scripting.FileSystemObject").OpenTextFile(strTmpFile).ReadAll
Ping = Replace(Ping, vbCrLf, "", 1)
On Error Resume Next
Kill strTm
End Function |
|