0
how to detect witch key is pressed with console.readkey
please help
2 Answers
0
You can use the Console.ReadKey(true).Key property to read the pressed key.
Add the following code to your Main method:
Console.WriteLine("Please press a key: ");
string a = Console.ReadKey(true).Key.ToString();
Console.WriteLine("\nYou pressed [ {0} ] key.", a);
0
wow thank you that you take the time :3 its really helped me