提问
如何获取枚举值
回答
//获取枚举的10进制
DeviceTypeEnum.ToString("d");
//获取枚举的16进制
DeviceTypeEnum.ToString("x2");
示例
public enum DeviceType
{
[Display(Name = "10KV配电设备")] _201 = 0x201,
[Display(Name = "35KV配电设备")] _202 = 0x202,
[Display(Name = "110KV配电设备")] _203 = 0x203,
[Display(Name = "直流操作电源柜")] _231 = 0x2E1
}