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 == null) return string.Empty;

      return o.ToString();
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2022-01-17
  • 2022-12-23
  • 2022-02-17
  • 2022-12-23
  • 2021-08-21
猜你喜欢
  • 2021-08-21
  • 2021-07-27
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案