private static User getSuccessfulLogInUser() { Console.WriteLine("------Login--------"); int counter = 0; while (true) { Console.WriteLine("Please enter username: "******"Please enter password: "******"Log in successfully."); return(user); } else { Console.WriteLine("Log in fail"); counter++; if (counter == 3) { Console.WriteLine("You have 3 unseccessful traing please wait 3 minutes and try again"); Console.WriteLine(DateTime.Now.ToLongTimeString()); var stopwatch = Stopwatch.StartNew(); Thread.Sleep(180000); stopwatch.Stop(); Console.WriteLine(stopwatch.ElapsedMilliseconds); Console.WriteLine(DateTime.Now.ToLongTimeString()); counter = 0; } } } }