i tried :
while (!(Console.KeyAvailable && Console.ReadKey(true).Key == ConsoleKey.Escape))
{
// do something
}
this not help me it didn't do what i need .. my code is :
Console.WriteLine("Please enter your Login Details:");
Console.Write("User Name: ");
string userName = Console.ReadLine();
Console.Write("Password: ");
string Password = Console.ReadLine();
if (cmd.Login(userName, Password))
{
// my rest of my code
}
what i need in any console.readline()
if i pressed ESC go to first code or start to put username and password ...
i need to press ESC in my app it restart to the first stage at any time and any stage .. is this possible ?