var status = new Enums.AffairsOperatingResult();
int typeNum = 0;
int.TryParse(statusStr, out typeNum);
try
{
status = (Enums.AffairsOperatingResult)Enum.Parse(typeof(Enums.AffairsOperatingResult),
typeof(Enums.AffairsOperatingResult).GetEnumName(typeNum));
}
catch (Exception)
{
}
原文:http://www.cnblogs.com/wdw31210/p/3793078.html