Get values of parameters of a given method

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
 
S

Sean Hederman

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?
 
G

Guest

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?
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top