Hello
I'm new to VB.Net and try to create a console applicatione which will
redirect the output to an arraylist.
I found a very good sample at:
http://dotnet.mvps.org/dotnet/sample...ectConsole.zip
Basically it works. But the problem is I'm unsure about the invoke. The
results will only be added (AddTextToArray ) if the application is
finished with all procedures. This seems to be the synchronus call from
the invoke. I need to make multiple calls to the console and need the
results from the first call. How wil I know when the program is finished
and how can I triger the other calls to the console.
Private Sub StreamOutput()
Dim Line As String = m_Process.Stand ardOutput.ReadL ine()
Try
Do While Line.Length >= 0
If Line.Length 0 Then
AddText(Convert FromOem(Line))
End If
Line = m_Process.Stand ardOutput.ReadL ine()
Loop
Catch
Debug.Print(Str ing.Format("""{ 0}"" wurde beendet!",
m_Process.Start Info.FileName))
End Try
End Sub
Private Sub AddText(ByVal Text As String)
m_TextToAdd = Text
Me.Invoke(CType (AddressOf Me.AddTextToArr ay, MethodInvoker))
End Sub
Private Sub AddTextToArray( )
If ConsoleInitiali zed Then
ConsoleResults. Add(m_TextToAdd )
End If
End Sub
Please be aware I'm very new to VB.Net.....
appreciating any help
Regards
Manfred