Get values of parameters of a given method

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!

I want to analyse the values of the parameters of a given method.

With the method GetParameters() of a MethodInfo object you receice an array
of ParameterInfo objects. This helps you to get all information about the
parameters of a method (i.e. name, type, etc.). But you can not get the
current value of each parameter.

Can you help me, please, to find out the current value of each parameter?

Is it the right way to do it with System.Reflection, because it helps you to
read the metadata (but not the current values
 
AFAIK, you can't do this because the parameters are transient. The only
place to get the parameters is within the method itself, unless you use an
interception-base AOP system. Perhaps we could help more if we know why you
want to do this?
 
Hi Sean!

What do I want to do? I want to save the parameter values of a method in a
log database with log4net.

Do you think a interception-base AOP system is the right way? I know
interceptions, but what do yo mean the AOP system?
 
Hi!

I was blinded (by german language ;-) I guess) to see that's AOP stands for
Aspect Oriented Programming! But now I understand how to solve my problem.

Thanks for you quick help, Sean.
 
Back
Top