Mega Code Archive

 
Categories / C# by API / System
 

Console Read()

using System;    class MainClass {      public static void Main() {      char ch;        Console.Write("Press a key followed by ENTER: ");        ch = (char) Console.Read(); // get a char           Console.WriteLine("Your key is: " + ch);    }    }