c# - How to create a console window within windows forms?

  • Thread starter Thread starter Tornadocraver
  • Start date Start date
T

Tornadocraver

Guest
So Im making this program that you have to sign in to access the features of a console program that I make. The only problem is that I made the sign in page in Windows Forms, and not through the console application. What I want to know is 1-If it is possible to insert/add a console into the same project, and just un-hide it if the password combination matches. And 2-How to create it.

Pseudocode on how I plan to un-hide it currently:

private void buttonSignIn_Click(object sender, EventArgs e)

{

if (txtUser.Text == "Tornadocraver")

{

if (txtPassword.Text == "148260")

{

this.Hide();

consoleCMD ss = new consoleCMD(); //The console window would be called, "consoleCMD."

ss.Show();

MessageBox.Show("Welcome to the command-line interface!")

}

}

}

I would be fine with doing it this way, but I dont know how to add a console window to my project. I really would like to keep it in the same application if possible, but if worse comes to worse, I can just start another application from the main. Feel free to edit my code/shoot me an answer.

Thanks,

Tornadocraver.

Continue reading...
 
Back
Top