0

Basically in my code I want it to display the next lines after the user presses a key. I thought it was ReadKey, but after I press a key it closes.

For Example

WriteLine("Press any key to display invoice...");
ReadKey(); //this part

WriteLine("***************************");
WriteLine("***  Corporation ***");
WriteLine("Customer Invoice \r\n");
WriteLine("SHIP TO: ");
AlexWei
  • 1,093
  • 2
  • 8
  • 32

1 Answers1

2

You need another ReadKey before the program ends

Console.WriteLine("Press any key to display invoice...");
Console.ReadKey(); //this part

Console.WriteLine("***************************");
Console.WriteLine("***  Corporation ***");
Console.WriteLine("Customer Invoice \r\n");
Console.WriteLine("SHIP TO: ");

// if you dont do this, the program ends and you cant see the other lines
Console.ReadKey(); 
TheGeneral
  • 79,002
  • 9
  • 103
  • 141