Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. Sub Go()
  2. Dim p As New Process
  3. p.StartInfo.FileName = mainloc & "utserver.exe"
  4. p.StartInfo.UseShellExecute = False
  5. p.StartInfo.RedirectStandardOutput = True
  6. AddHandler p.OutputDataReceived, AddressOf HelloMum
  7. MsgBox(p.StartInfo.FileName.ToString)
  8. p.Start()
  9. p.BeginOutputReadLine()
  10. End Sub
  11.  
  12. Sub HelloMum(ByVal sender As Object, ByVal e As DataReceivedEventArgs)
  13. UpdateTextBox(e.Data)
  14. End Sub
  15. Private Delegate Sub UpdateTextBoxDelegate(ByVal Text As String)
  16. Private Sub UpdateTextBox(ByVal Tex As String)
  17. If Me.InvokeRequired Then
  18. Dim del As New UpdateTextBoxDelegate(AddressOf UpdateTextBox)
  19. Dim args As Object() = {Tex}
  20. Me.Invoke(del, args)
  21. Else
  22. RichTextBox1.Text &= Tex & Environment.NewLine
  23. End If
  24. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement