Here's a little snippet from an app of mine. LineInput(1) represents
each line of the logfile being looped through. Modify as necessary.
R/
T$
For Each machine In ListBox1.Items
Try
log = "\\" & machine & "\" & MyVal5 &
"\" & MyVal4
logdatetime = File.GetLastAccessTime(log)
FileOpen(1, log, OpenMode.Input)
Do Until EOF(1)
strText = LineInput(1)
If InStr(strText, "exit status [0]") > 0 Then :
ExitC = "Radconct Exit Status [0]" : success = "y" : End If
If InStr(strText, "exit status [857]") > 0 Then
: ExitC = "Radconct Exit Status [857]" : success = "y" : End If
If InStr(strText, "exit status [858]") > 0 Then
: ExitC = "Radconct Exit Status [858]" : success = "y" : End If
If InStr(strText, "exit status [811]") > 0 Then
: ExitC = "Radconct Exit Status [811]" : success = "y" : End If
If InStr(strText, "exit status [200]") > 0 Then
: ExitC = "Radconct Exit Status [200]" : success = "n" : End If
If InStr(strText, "exit status [202]") > 0 Then
: ExitC = "Radconct Exit Status [202]" : success = "n" : End If
If InStr(strText, "exit status [650]") > 0 Then
: ExitC = "Radconct Exit Status [650]" : success = "n" : End If
If InStr(strText, "exit status [709]") > 0 Then
: ExitC = "Radconct Exit Status [709]" : success = "n" : End If
Loop
FileClose(1)
If ExitC = "" Then : success = "Exit Code Not Found"
End If
Dim oItem1 As ListViewItem =
Results.Items.Add(UCase(machine))
oItem1.SubItems.Add(" " & ExitC & " ")
oItem1.SubItems.Add(" " & logdatetime & " ")
*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*