Here a piece of the code
Code:
Private Sub DisplayOutput(ByVal sendingProcess As Object, ByVal output As DataReceivedEventArgs)
OutText.AppendText(output.Data() & vbCrLf)
End Sub
Public Function ziload(ByVal para As String)
If (My.Computer.FileSystem.FileExists("ziphone.exe")) Then
If (firsttime) Then
With P
AddHandler P.OutputDataReceived, AddressOf DisplayOutput
.StartInfo.CreateNoWindow() = True
.StartInfo.UseShellExecute = False
.StartInfo.RedirectStandardInput = False
.StartInfo.RedirectStandardOutput = True
.StartInfo.FileName = "ziphone.exe"
.StartInfo.Arguments = para
.SynchronizingObject = OutText
firsttime = False
End With
End If
P.Start()
P.BeginOutputReadLine()
disabler()
Else
MsgBox("File """ & "ziphone.exe" & """ does not exist !", MsgBoxStyle.Exclamation, "File not found")
enabler()
End If
End Function
Public Function closer()
If Not (P Is Nothing) Then
P.CancelOutputRead()
P.Kill()
End If
enabler()
End Function
