























enum Score
{
EE,EX,BE,ME,PME
}
枚举的遍历
foreach( Scorecity in enum.getvalues( typeof( Score) ) )
{
}
字符串转枚举
Score enumtype;
string strTypeB = "EE";
enumtype = (Score)Enum.Parse(typeof(Score),strTypeB);
枚举转字符串
myScore enumtype = Score.EE;
string strTypeB = Enum.GetName(typeof(myScore ), enumtype);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。