用户名和密码输入练习

        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();

        }

 

posted @ 2024-08-11 12:42  CSF践行  阅读(1)  评论(0编辑  收藏  举报