/// <summary> /// 遍历普通枚举 /// </summary> /// <returns></returns> public static void ForEachEnum() { foreach (string Type in Enum.GetNames(typeof(shopInfo))) { shopInfo type = (shopInfo)Enum.Parse(typeof(shopInfo), Type); string Key = type.ToString(); string EnumValue = type.GetHashCode().ToString(); } }
/// <summary> /// 根据枚举Key 获取枚举的序号 /// </summary> /// <returns></returns> public static void ForEachEnum(shopInfo parm) { shopInfo type = parm; string Key = type.ToString(); string EnumValue = type.GetHashCode().ToString(); }