To be honest, I tried to find a tittle for this but i couldn't think of any
I'm creating an application using visual basic 2010 that i will be using/running on Backtrack 5 R3, I tried it and it works fine, But i needed to add a Terminal to the application, Instead of opening Terminal on backtrack, I want to have it built in my application
Any idea guys how to do that?
thanks :)
This is the code that i had to add windows Command "CMD", But this works with Windows ONLY
>
>
>
ublic Class Form1
Private WithEvents MyProcess As Process
Private Delegate Sub AppendOutputTextDelegate(ByVal text As String)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Width = 488
Me.AcceptButton = Button1
MyProcess = New Process
With MyProcess.StartInfo
.FileName = "CMD.EXE"
.UseShellExecute = False
.CreateNoWindow = True
.RedirectStandardInput = True
.RedirectStandardOutput = True
.RedirectStandardError = True
End With
MyProcess.Start()
MyProcess.BeginErrorReadLine() 'start async read on stderr
MyProcess.BeginOutputReadLine() 'start async read on stdout
AppendOutputText("Process Started at: " & MyProcess.StartTime.ToString)
End Sub
Private Sub MyProcess_ErrorDataReceived(ByVal sender As Object, ByVal e As System.Diagnostics.DataReceivedEventArgs) Handles MyProcess.ErrorDataReceived
AppendOutputText(vbCrLf & "Error: " & e.Data)
End Sub
Private Sub MyProcess_OutputDataReceived(ByVal sender As Object, ByVal e As System.Diagnostics.DataReceivedEventArgs) Handles MyProcess.OutputDataReceived
AppendOutputText(vbCrLf & e.Data)
End Sub
Private Sub AppendOutputText(ByVal text As String)
If OutputTextBox.InvokeRequired Then
Dim myDelegate As New AppendOutputTextDelegate(AddressOf AppendOutputText)
Me.Invoke(myDelegate, text)
Else
OutputTextBox.AppendText(text)
End If
End Sub
'button1 coding
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MyProcess.StandardInput.WriteLine(InputTextBox.Text)
MyProcess.StandardInput.Flush()
End Sub
End Class