- ©«¤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
|
¦^´_ 6# c_c_lai
°²³]a1¦Üa10Àx¦s®æ¤º®e¦U¬°100.18.22.1¦Ü100.18.22.10¡A¦Ó±Npingªºµ²ªG¨Ì§Ç©ñ¦bB1¦ÜB10ªºÀx¦s®æ¤W¡Aµ{¦¡¦p¤U¡A¤w¸g´ú¸Õ¦bxp¤ÎW7¡A32¦ì¤¸¥i¥H°õ¦æ¡A¦ý¦bW7¡A64¦ì¤¸¨t²Î«h¦b RetVal = Shell("command.com /c Ping -n 1 " & Cells(i, 1) & " > " & ThisWorkbook.Path & "\" & i & ".txt") ³o¦æ«ü¥Oµo¥Í¿ù»~¡A½Ð°Ý¦p¦ó×¥¿¡HÁÂÁ¡I
¥t¥~¤£ª¾¦³µL¤èªkª½±µ±N ping ªºµ²ªGª½±µ¼g¤JB1¦ÜB10ªºÀx¦s®æ¡A¦Ó¤£¥²¸g¥Ñ¼g¤JtxtÀÉ«á¡A¦A¶}±ÒtxtÀɱN¨ä¼g¤JB1¦ÜB10Àx¦s®æ¤º¡C¤Q¤À·P¿E¡I
Sub Test()
Columns("B:C").Select
Selection.ClearContents
¶O®É = Timer
For i = 1 To 10
RetVal = Shell("command.com /c Ping -n 1 " & Cells(i, 1) & " > " & ThisWorkbook.Path & "\" & i & ".txt")
Next i
¥ð®§ = Timer
Do While Timer - ¥ð®§ < 2
DoEvents
Loop
For i = 1 To 10
¤å¦rÀÉ = ThisWorkbook.Path & "\" & i & ".TXT"
¥N½X = FreeFile ' ¨ú±o¥¼¨Ï¥ÎªºÀÉ®×¥N½X¡C
Open ¤å¦rÀÉ For Input As #¥N½X
¦rªø = LOF(¥N½X)
Cells(i, 2) = Input(¦rªø, #¥N½X)
Close #¥N½X ' Ãö³¬ÀɮסC
Next i
Cells(1, 3) = Timer - ¶O®É
End Sub |
|