static void Main(string[] args) { WebSite fx = new WebSite("产品展示"); fx.Use(); WebSite fy = new WebSite("产品展示"); fy.Use(); WebSite fz = new WebSite("产品展示"); fz.Use(); WebSite fl = new WebSite("博客"); fl.Use(); WebSite fm = new WebSite("博客"); fm.Use(); WebSite fn = new WebSite("博客"); fn.Use(); Console.Read(); }
static void Main(string[] args) { WebSiteFactory f = new WebSiteFactory(); WebSite fx = f.GetWebSiteCategory("产品展示"); fx.Use(new User("小菜")); WebSite fy = f.GetWebSiteCategory("产品展示"); fy.Use(new User("大鸟")); WebSite fz = f.GetWebSiteCategory("产品展示"); fz.Use(new User("娇娇")); WebSite fl = f.GetWebSiteCategory("博客"); fl.Use(new User("老顽童")); WebSite fm = f.GetWebSiteCategory("博客"); fm.Use(new User("桃谷六仙")); WebSite fn = f.GetWebSiteCategory("博客"); fn.Use(new User("南海鳄神")); Console.WriteLine("得到网站分类总数为 {0}", f.GetWebSiteCount()); //string titleA = "大话设计模式"; //string titleB = "大话设计模式"; //Console.WriteLine(Object.ReferenceEquals(titleA, titleB)); Console.Read(); }
static void Main(string[] args) { WebSiteFactory f = new WebSiteFactory(); WebSite fx = f.GetWebSiteCategory("產品展示"); fx.Use(new User("小菜")); WebSite fy = f.GetWebSiteCategory("產品展示"); fy.Use(new User("大鳥")); WebSite fz = f.GetWebSiteCategory("產品展示"); fz.Use(new User("嬌嬌")); WebSite fl = f.GetWebSiteCategory("部落格"); fl.Use(new User("老頑童")); WebSite fm = f.GetWebSiteCategory("部落格"); fm.Use(new User("桃谷六仙")); WebSite fn = f.GetWebSiteCategory("部落格"); fn.Use(new User("南海鱷神")); Console.WriteLine("得到網站分類總數為 {0}", f.GetWebSiteCount()); //string titleA = "大話設計模式"; //string titleB = "大話設計模式"; //Console.WriteLine(Object.ReferenceEquals(titleA, titleB)); Console.Read(); }