Getting Field Value with Reflection?

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hello,

I'm currently using reflection to get some data from an assembly
created from a web form that has elements such as a DataGrid, DataSet,
etc. I also have a label control. Getting the fields, methods, etc
is no problem but where I'm having difficulty is obtaining the text
value assigned to the label (on the button click). I can see the
string in ilDasm.exe but having trouble picking it up with GetValue().
Any info would be appreciated.

Johnny
 
What sort of trouble are you having? Keep in mind, if you're using
Label.Text, and not the private field, you're looking at a property, not a
field, so you having to use the appropriate flags.

Chris
 
Back
Top