How to handle key press event in C# console application

For console application you can do this, the do while loop runs untill you press x public class Program { public static void Main() { ConsoleKeyInfo keyinfo; do { keyinfo = Console.ReadKey(); Console.WriteLine(keyinfo.Key + ” was pressed”); } while (keyinfo.Key != ConsoleKey.X); } } This will only work if your console application has focus. If … Read more

How to handle key press event in console application

For console application you can do this, the do while loop runs untill you press x public class Program { public static void Main() { ConsoleKeyInfo keyinfo; do { keyinfo = Console.ReadKey(); Console.WriteLine(keyinfo.Key + ” was pressed”); } while (keyinfo.Key != ConsoleKey.X); } } This will only work if your console application has focus. If … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)