用户名和密码输入练习
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(); }