将枚举类型转换为字符串:
//枚举类publicic enum UserRoleEnum { /// <summary> /// 系统管理员 /// </summary> Admin = 1, /// <summary> /// Workcelllll经理 /// </summary> Manager = 2, /// <summary> /// 监管员 /// </summary> Supervisor = 3, /// <summary> /// 高级用户 /// </summary> Operator2 = 4, /// <summary> /// 初级用户 /// </summary> Operator1 = 5 }//枚举类型转换为字符串值stringvalue = Enum.GetName(typeof(UserRoleEnum),1)//value值Admin