[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to create a winform version of the command prompt

Posted on 2010-11-19
2
Medium Priority
?
319 Views
Last Modified: 2013-11-05
I am trying to duplicate a command prompt with winforms.  I can stream the output of the command prompt to the winform's text box.  I know that I need to use something like the attached code.  But what I don't know how to do is :

1.   How to capture user input & responses
2.   How to send user input & responses to the command prompt I am streaming the output from.
3.   How to display the new user input in the text box and continue to stream the output.
     

     
Using p As Process = New Process
            Dim SR As System.IO.StreamReader
            Dim SW As System.IO.StreamWriter
            Dim NTF As Boolean = True

            p.StartInfo.FileName = Path
            p.StartInfo.UseShellExecute = False
            p.StartInfo.Arguments = Arguments
            p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
            p.StartInfo.CreateNoWindow = True
            p.StartInfo.RedirectStandardOutput = True
            p.StartInfo.RedirectStandardInput = True
            p.Start()
            SR = p.StandardOutput
            SW = p.StandardInput

            While Not p.HasExited
                Do Until SR.EndOfStream = True
                    rtb1.AppendText("   " & SR.ReadLine & vbLf)
                    Application.DoEvents()
                Loop
            End While
End Using

Open in new window

0
Comment
Question by:NevSoFly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 34179608
0
 

Author Closing Comment

by:NevSoFly
ID: 34364044
sorry for being so late
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question