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.StandardOutput.ReadLine()
Try
Do While Line.Length >= 0
If Line.Length 0 Then
AddText(ConvertFromOem(Line))
End If
Line = m_Process.StandardOutput.ReadLine()
Loop
Catch
Debug.Print(String.Format("""{0}"" wurde beendet!",
m_Process.StartInfo.FileName))
End Try
End Sub
Private Sub AddText(ByVal Text As String)
m_TextToAdd = Text
Me.Invoke(CType(AddressOf Me.AddTextToArray, MethodInvoker))
End Sub
Private Sub AddTextToArray()
If ConsoleInitialized Then
ConsoleResults.Add(m_TextToAdd)
End If
End Sub
Please be aware I'm very new to VB.Net.....
appreciating any help
Regards
Manfred