https://www.cnblogs.com/TanSea/p/6923743.html
public enum EnumSex { /// <summary> /// 男 /// </summary> [Description("男")] Male = 0, /// <summary> /// 女 /// </summary> [Description("女")] Female = 1 } public string GetEnumDescription(Enum enumValue) { string value = enumValue.ToString(); FieldInfo field = enumValue.GetType().GetField(value); object[] objs = field.GetCustomAttributes(typeof(DescriptionAttribute), false); //获取描述属性 if (objs == null || objs.Length == 0) //当描述属性没有时,直接返回名称 return value; DescriptionAttribute descriptionAttribute = (DescriptionAttribute)objs[0]; return descriptionAttribute.Description; } //调用 string sex = GetEnumDescription(EnumSex.Female); //sex = "女"