Solved

How do I reflect output from dos command?

Posted on 2004-09-10
7
202 Views
Last Modified: 2012-05-05
Hi, I am new to VB & .net.

I need to create a simple application that will allow me to have a button pushed that reflects dos command and then the output reflected in a return box.  I also need to be able to add variables to the button(s) instructions.

if you need more info, please let me know.
0
Comment
Question by:ganongj
  • 4
  • 3
7 Comments
 
LVL 3

Expert Comment

by:imu79
ID: 12028075
Could you clarify a bit please..

Imran.
0
 
LVL 4

Author Comment

by:ganongj
ID: 12028428
Here's an example:

a gui interface to traceroute.
a button on the vb interface that runs traceroute, some text box for variables to use when button pushed (the i.p. address to be tracerouted)
a box that reflects the results and stays there until closed.
0
 
LVL 3

Expert Comment

by:imu79
ID: 12029024
So basically you want to redirect the ouput from the console (command) window to some textbox.

here's an example that should work:

http://dotnet.mvps.org/dotnet/samples/miscsamples/downloads/RedirectConsole.zip

Note that in the sample. a new thread is created to read the output since the output is being dynamically generated. If you just tried to read the output, you could run into problems.

hope that helps..
Imran.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 4

Author Comment

by:ganongj
ID: 12030230
Ha ha, very funny, the example is in German!
0
 
LVL 3

Accepted Solution

by:
imu79 earned 500 total points
ID: 12030391
well..that wasn't meant to be a joke. yes, the comments are in a different language (i'm not sure which one..) but the code is still in english, right? I mean you should be able to get an idea from that.

anyway, Here's another version of the same thing (slightly different):

http://tinyurl.com/4jwys

Everything is the same as the previous sample except the reading of the output. You should start the reading of the output in another thread since the output is being generated dynamically and it would freeze your application till the read is complete. Just use the code to start the process from the link above and use the threading technique that's in the sample that I sent you earlier. It should be easy to read. Let me know if you have any problems.

hope that helps..
Imran.
0
 
LVL 4

Author Comment

by:ganongj
ID: 12102434
This really hasn't answered my question so I am leaving it open.

Jim
0
 
LVL 4

Author Comment

by:ganongj
ID: 12189504
I give up.  No answer given. apparently no  one knows.

Jim
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
vb.net help 4 34
Store results in vb.net 3 24
VB.NET 2008 - Windows Protected Your PC 7 41
VB.NET 2008 Winforms Signing 13 32
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 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