static void Main(string[] args) { atmmachine one = new atmmachine(); bool flag = true; while (flag) { Console.Clear(); Console.WriteLine("ATM Login"); Console.WriteLine("Enter Account ID:"); int q = new int(); q = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Enter Password:"******"Invalid User ID"); } if (w < 10000 && w > 99999) { Console.WriteLine("Invalid Password"); } else { one.signin(q, w); flag = false; } } }
static void Main(string[] args) { atmmachine one = new atmmachine(); bool flag = true; ConsoleKeyInfo kk; string pwd = ""; while (flag) { Console.Clear(); Console.WriteLine("ATM Login"); Console.WriteLine("Enter Account ID:"); int q = new int(); q = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Enter Password:"******"*"); } else if (kk.Key == ConsoleKey.Backspace && pwd.Length > 0) { pwd = pwd.Substring(0, pwd.Length - 1); Console.Write("\b \b"); } } while (kk.Key != ConsoleKey.Enter); int w = new int(); w = Convert.ToInt32(pwd); if (q < 10000 && q > 99999) { Console.WriteLine("Invalid User ID"); } if (w < 10000 && w > 99999) { Console.WriteLine("Invalid Password"); } else { one.signin(q, w); flag = false; } } }