title: C# prevent CMD from Closing Automatically after running?
body: <p>I  want to prevent CMD from closing automatically after running the program.</p>
  
  <p>Code:</p>
  
  <pre><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");
      }
  </code></pre>
  
  <p>Screenshot:
  <img src="https://i.stack.imgur.com/SiyD4.jpg" alt="after running screenshot"></p>
  
  <p>I want to show the following after running and prevent cmd from closing:</p>
  
  <pre><code>Thank you! your logged in as John Smith 12345
  </code></pre>
  
  <p>Any  answers would be appreciated.</p>
  
  <p>Thank you.</p>