edpatterson
IS-IT--Management
- Feb 24, 2005
- 186
This was not copied from the IDE but entered directly into the form. It should be close enough to get the point across.
:source.txt:
machine1
machine2
machine3
machine4
machine3 is not in DNS
When the loop hits machine3 an exception is thrown and the loop exits. I would like it to resume with machine4.
I actually have 1500 machines to check so production code it radically different
:source.txt:
machine1
machine2
machine3
machine4
machine3 is not in DNS
Code:
dim sr as StreamReader = New StreamReader("c:\source.txt")
dim strComputer as Sting = sting.empty
try
while not sr.AtEndOfStream
strComputer = sr.readline
if my.computer.network.ping(strComputer) Then
lbAlive.items.add(strComputer)
End if
End While
catch ex as exception
msgbox(ex.message & " " & strComputer,,"Error...")
End Try
When the loop hits machine3 an exception is thrown and the loop exits. I would like it to resume with machine4.
I actually have 1500 machines to check so production code it radically different