static void Main(string[] args) { string strUsrName = ""; string strPwd = ""; Console.WriteLine("please input your UsrName:"); strUsrName = Console.ReadLine(); while (strUsrName != "admin") { Console.WriteLine("the UsrName is error, input again!"); strUsrName = Console.ReadLine(); } Console.WriteLine("please input your passward:"); strPwd = Console.ReadLine(); while (strPwd!="88888888") { Console.WriteLine("the passward is error, input again!"); strPwd = Console.ReadLine(); } Console.WriteLine("the UsrName and passward is OK!"); Console.ReadKey(); }
标签:用户名,Console,练习,strPwd,密码,WriteLine,input,ReadLine,strUsrName From: https://www.cnblogs.com/csflyw/p/18353259