私は方法を持っています
public void SomeMethod(string PersonName,int Age)
{
// get call stack
StackTrace stackTrace = new StackTrace();
// should equal "SomeMethod"
var MethodName = stackTrace.GetFrame(0).GetMethod().Name;
// should be ParameterInfo of parameter "PersonName"
var firstParam = stackTrace.GetFrame(0).GetMethod().GetParameters()[0];
// Here is where I get stuck !!!!!!!
var t = firstParam.GetValue();
その値を取得するために、firstParamパラメーターが指す場所への参照を取得するにはどうすればよいですか?
PersonNameで取得できることはわかっていますが、firstParamを介してその情報を取得したいと思います。