I want to prevent CMD from closing automatically after running the program.
Code:
static void Main(string[] args)
{
FileStream textfsw = new FileStream("fileone.txt", FileMode.Append, FileAccess.Write); // CREATING FILE
StreamWriter textsw = new StreamWriter(textfsw);
Console.Write(" Enter your ID: ");
int ID = int.Parse(Console.ReadLine());
Console.Write(" Enter your Name: ");
string Name = Console.ReadLine();
Console.WriteLine(" Thank you! your logged in as" +Name+ +ID);
textsw.Close();
textfsw.Close();
FileStream textfs = new FileStream("fileone.txt", FileMode.Open, FileAccess.Read); // READING A FILE USING ReadAllLines
StreamReader textsr = new StreamReader(textfs);
String[] lines = File.ReadAllLines("fileone.txt");
}
Screenshot:
I want to show the following after running and prevent cmd from closing:
Thank you! your logged in as John Smith 12345
Any answers would be appreciated.
Thank you.