using System; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Prog
获取: Type type = typeof(ParamServiceType); var values = Enum.GetValues(type); ; i < values.Length; i++) { var v = values.GetValue(i); var member = type.GetMember(v.ToString()); DescriptionAttribute des = (DescriptionAttribute)System.Attribute.GetCusto
public static string GetObjectPropertyValue<T>(T t, string propertyname){ Type type = typeof(T); PropertyInfo property = type.GetProperty(propertyname); if (property == null) return string.Empty; object o = property.GetValue(t, null); if (o == n