S
s.luongo
Hello everybody,
Trying to get all attributes from a class (class1), I got them through
properties, is it a simple way to get all class atributes not using
their properties??
public void GetAllClassAttributes()
{
Type classType = class1.GetType();
PropertyInfo[] a_pi= classType.GetProperties();
foreach ( PropertyInfo pi in a_pi)
{
if ( pi.CanRead ) pi.GetValue(resumen, null).ToString();
}
Console.Read();
}
Trying to get all attributes from a class (class1), I got them through
properties, is it a simple way to get all class atributes not using
their properties??
public void GetAllClassAttributes()
{
Type classType = class1.GetType();
PropertyInfo[] a_pi= classType.GetProperties();
foreach ( PropertyInfo pi in a_pi)
{
if ( pi.CanRead ) pi.GetValue(resumen, null).ToString();
}
Console.Read();
}