信息交流、传播、提炼

nice to meet you

博客园 首页 新随笔 联系 订阅 管理
(Days)Enum.Parse(typeof(Days),7.ToString());  
   
  以下是msdn例子  
  enum   Colors   {   Red   =   1,   Green   =   2,   Blue   =   4,   Yellow   =   8   };  
   
  public   static   void   Main()    
  {  
   
  Console.WriteLine("The   entries   of   the   Colors   Enum   are:");  
  foreach(string   s   in   Enum.GetNames(typeof(Colors)))  
  Console.WriteLine(s);  
   
  Console.WriteLine();  
   
  Colors   myOrange   =   (Colors)Enum.Parse(typeof(Colors),   "4");  
  Console.WriteLine("The   myOrange   value   has   the   combined   entries   of   {0}",   myOrange);  
  }
posted on 2009-07-02 14:53  seeyou  阅读(361)  评论(0)    收藏  举报