ImがPropertyInfo[]
から値を取得しようとしなさい、私はそれが仕事を得るカント:propertyinfo値
foreach (var propertyInfo in foo.GetType().GetProperties())
{
var value = propertyInfo.GetValue(this, null);
}
は例外:そのが行われることになってどのようにこのイマイチObject does not match target type.
?
'this'と' foo'のタイプは何ですか? – BNL
'this'は' propertyInfo'で表されるプロパティを含んでいますか? –