使用者名稱和密碼輸入練習

CSF践行發表於2024-08-11
        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();

        }

相關文章