摘要: 先申明一个枚举: public enum Test_Enum { one = 1001, two = 1002, three = 1003, four = 1004, five = 1005, six = 1006, seven = 1007, eight = 1008, nine = 1009, zero = 1000 }获取值: object ojb = Enum.GetName(typeof(Test_Enum),Test_Enum.eight); int i = (int)Test_Enum.eight; 阅读全文
posted @ 2013-09-30 14:17 JasonGu0 阅读(2226) 评论(0) 推荐(0) 编辑
摘要: [AttributeUsage(AttributeTargets.Field)] public class EnumExtension : Attribute { private string title; public EnumExtension(string title) { this.title = title; } public static string Get(Type tp, string name) { MemberInfo[] m... 阅读全文
posted @ 2013-09-30 13:54 JasonGu0 阅读(1797) 评论(0) 推荐(0) 编辑