C#中可以对枚举类型用Description特性描述. 如果需要对Description信息获取,那么可以定义一个扩展方法来实现.代码如下: public static class EnumExtensions { public static string GetDescription(this object value) { if (value==null) return string.Empty; Type type = value.GetType(); var fieldInfo = ty
结构体 class Program { struct student { public int num; public string name; public string sex; public one oone; public int[] qq; } struct one { public string aa; public int bb; } static void Main(string[] args) { ////struct ////初始化结构体 //student stu = ne