Sorry Herfried.....alot of this should look famiilar to you as I found bits
of it at
http://dotnet.mvps.org/dotnet/sample...ectConsole.zip
ElseIf Me.btnNetwork.Checked = True Then
mProcess = New Process
With mProcess.StartInfo
.FileName = "repstore.exe"
.Arguments = "3104"
.CreateNoWindow = True
.UseShellExecute = False
.RedirectStandardInput = True
.RedirectStandardOutput = True
End With
mProcess.Start()
Dim ts1 As ThreadStart = New ThreadStart(AddressOf StreamOutput)
mOutputStream = New Thread(ts1)
mOutputStream.Start()
blah blah other stuff....
Private Sub StreamOutput()
Dim strLine As String = mProcess.StandardOutput.ReadLine()
Try
Do While strLine.Length >= 0
If strLine.Length <> 0 Then
AddText(strLine)
End If
strLine = mProcess.StandardOutput.ReadLine()
Loop
Catch
End Try
End Sub
Private Sub AddText(ByVal strText As String)
mStrText = strText
Me.Invoke(CType(AddressOf Me.addTextToTextBox, MethodInvoker))
Dim fileNametoOpen, testChar As String
Dim found, intboxLength, intx, inty, intz As Integer
If strText.EndsWith(".txt") Then 'check for a textfile then put in
the textbox.
intboxLength = strText.Length
inty = intboxLength
For intx = intboxLength To 0 Step -1
found = strText.IndexOf(" ", inty)
If found > 0 Then
fileNametoOpen = strText.Substring(found + 1, intz - 1)
Call AddTextFromfile(fileNametoOpen)
Exit For
End If
intz = intz + 1
inty = inty - 1
Next intx
End If
End Sub
Private Sub addTextToTextBox()
Me.TextBox2.AppendText(mStrText & ControlChars.NewLine)
Me.TextBox2.SelectionStart = Me.TextBox2.Text.Length
End Sub
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:u%******************@TK2MSFTNGP09.phx.gbl...
"Thom" <la*****@charter.net> schrieb: redirects the output of the DOS program to a textbox.
All is well and fine while I am in Visual Studio and run in debug.
Redireted DOS output displays properly in he textbox.
I am starting the DOS porgram with a process using
.startinfo and friends.
Once I try to run the same executable from windows the
redirected output no longer displays in the textbox.
Hard to say without knowing anything about your code...
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>