Hi All;
I am trying to build a better interface for a dos SQL client, and rather than re-invent the wheel I thought I would just try to hook into the DOS program and lay my features on top of it.
Here is my code so far:
Problem is that nothing happens. If I comment out everything but the useshellexecute line (except the start() ) then I get a shell with the client. Anyhow, mysqlout is a richtextbox. For stage one I just want to get the DOS app running inside a richtextbox.
Any help would be greatly appreciated.
I am trying to build a better interface for a dos SQL client, and rather than re-invent the wheel I thought I would just try to hook into the DOS program and lay my features on top of it.
Here is my code so far:
Code:
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim mysql As Process = New Process
mysql.StartInfo.FileName = "d:\mysql\bin\mysql"
mysql.StartInfo.Arguments = "-u root -p"
mysql.StartInfo.UseShellExecute = False
mysql.StartInfo.CreateNoWindow = True
mysql.StartInfo.RedirectStandardError = True
mysql.StartInfo.RedirectStandardInput = True
mysql.StartInfo.RedirectStandardOutput = True
mysql.Start()
Dim mysqlin As System.IO.StreamWriter = mysql.StandardInput
Dim mysqlout As System.IO.StreamReader = mysql.StandardOutput
Dim myerror As System.IO.StreamReader = mysql.StandardError
mysqlin.AutoFlush = True
mysqlin.Write("mypassword")
output.Text = mysqlout.ReadToEnd
MsgBox(mysql.Responding)
Problem is that nothing happens. If I comment out everything but the useshellexecute line (except the start() ) then I get a shell with the client. Anyhow, mysqlout is a richtextbox. For stage one I just want to get the DOS app running inside a richtextbox.
Any help would be greatly appreciated.