Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("请输入笔记本品牌:");
            string   brand = Console.ReadLine();
            NoteBook nb    = GetNoteBook(brand);

            nb.SayHello();
            Console.ReadKey();
        }
Exemplo n.º 2
0
 static void Main(string[] args)
 {
     while (true)
     {
         Console.WriteLine("请输入笔记本品牌:");
         string brand = Console.ReadLine();
         try
         {
             if (brand.Equals("end", StringComparison.OrdinalIgnoreCase))
             {
                 break;
             }
             NoteBook nb = GetBook(brand);
             nb.SayHello();
             Console.ReadKey();
         }
         catch (Exception)
         {
         }
     }
 }