Vishal Sharma
Vishal Sharma

Reputation: 29

linking console to application so that the cmd box is not required

I had a thought of adding the console like in Netbeans IDE in my application, where we need not go for the black cmd box, everything is shown within the IDE.. Is it possible?

Upvotes: 0

Views: 22

Answers (2)

mrahhal
mrahhal

Reputation: 3497

You'll need this:

Process p = Process.GetCurrentProcess();
p.UseShellExecute = false;
p.RedirectStandardOutput = true;
using (StreamReader reader = process.StandardOutput)
{
    string result = reader.ReadToEnd();
    Console.Write(result);
}

But your question is to broad. This can help to:

System("Put_Your_Console_Command_Here");

And the command will get executed as if you wrote that in the cmd.\

Upvotes: 1

rory.ap
rory.ap

Reputation: 35270

Are you looking for the "Output" window? Try Debug > Windows > Output from the toolbar in Visual Studio.

Upvotes: 0

Related Questions