K
kplkumar
I am trying to get the method and the parameters passed to that method
from the stackTrace.
My code is,
private void GetExecutingMethodInfo()
{
StackTrace trace = new StackTrace(false);
for (int index = 0; index < trace.FrameCount; ++index)
{
StackFrame frame = trace.GetFrame(index);
MethodBase method = frame.GetMethod();
string methodName = method.Name;
ParameterInfo[ ] methodParameters = method.GetParameters();
break;
}
}
I can get the type and names of those parameters. But the issue is to
get the values of those parameters. Does anyone know how to do that?
from the stackTrace.
My code is,
private void GetExecutingMethodInfo()
{
StackTrace trace = new StackTrace(false);
for (int index = 0; index < trace.FrameCount; ++index)
{
StackFrame frame = trace.GetFrame(index);
MethodBase method = frame.GetMethod();
string methodName = method.Name;
ParameterInfo[ ] methodParameters = method.GetParameters();
break;
}
}
I can get the type and names of those parameters. But the issue is to
get the values of those parameters. Does anyone know how to do that?