- string usernaem=null, password=null;
- while(true){
- Console.WriteLine("请输入用户名");
- usernaem = Console.ReadLine();
- Console.WriteLine("请输入密码");
- password = Console.ReadLine();
- if (usernaem != "admin" || password != "888888")
- {
- Console.WriteLine("用户名或密码错误,请重新输入");
- continue;
- }
- else {
- break;
- }
- }
- Console.WriteLine("恭喜你!输入正确,欢迎登录本系统");
- Console.ReadKey();
复制代码 |