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

//我的枚举:   
public   enum   Subject   
  None   =   0,   
  Logon   =   1,   
  Logoff   =   2,   
  Ready   =   3,   
}   
    
//如何把字符串"Logon"转化成枚举型?
Subject  subject=(Subject)Enum.Parse(typeof(Subject),"Logon");


你可能感兴趣的:(如何把字符串转化为ENUM类型?)