如何把字符串转化为ENUM类型?

我的枚举:  
   
                      public   enum   Subject  
                                        None   =   0,  
  Logon   =   1,  
  Logoff   =   2,  
  Ready   =   3,  
                            }  
   
  如何把字符串"Logon"转化成枚举型?

 

 

Subject   subject=(Subject)Enum.Parse(typeof(Subject),"Logon");

posted on 2010-04-15 10:35  西湖浪子  阅读(296)  评论(0)    收藏  举报