首页 > 代码库 > c#枚举型遍历

c#枚举型遍历

public enum eErrorDetailCode : int {  登陆成功 = 0,  登出 = 1,  应用错误 = 2,  成功 = 16,  失败 = 17 }

foreach (

  int intError in Enum.GetValues(typeof(eErrorDetailCode))) {    

  strKey = intError.ToString();    

  strValue = http://www.mamicode.com/Enum.GetName(typeof(eErrorDetailCode), intError);

}

c#枚举型遍历