2015年11月5日 星期四

C5_1 string

using System;
namespace C5_1
{
    public class Program
    {
        public static void Main()
        {
            string userName, passworld;
            int i;
            for (i = 0; i < 3; i++)
            {
                Console.WriteLine("請輸入使用者名:");
                userName = Console.ReadLine();
                Console.WriteLine("請輸入密碼:");
                passworld = Console.ReadLine();
                if (userName.Trim().ToLower() == "admin" && passworld == "admin888")
                {
                    Console.WriteLine("你好,歡迎進入本系統!\n");
                    return;
                }
                else
                {
                    Console.WriteLine("對不起,你輸入的資訊輸入錯誤,請重新輸入\n");
                }
            }
        }
    }
}

沒有留言: