how can i get the value from fieldinfo. want to loop all properties and get
the value from my class
FieldInfo[] myFieldInfo;
Type myType = this.GetType();
// Get the type and fields of FieldInfoClass.
myFieldInfo = myType.GetFields(BindingFlags.Instance | BindingFlags.Public);
foreach (FieldInfo field in myFieldInfo)
{
try
{
s.Write( field.Name)
// does not work field.GetValue(null).ToString() );
}
catch
{
}
}
Mattias Sjögren - 17 Nov 2005 18:26 GMT
> // does not work field.GetValue(null).ToString() );
Replace null with this.
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.