我试图从a获得价值PropertyInfo[],但我无法让它工作:
foreach (var propertyInfo in foo.GetType().GetProperties())
{
var value = propertyInfo.GetValue(this, null);
}
Run Code Online (Sandbox Code Playgroud)
例外: Object does not match target type.
这不应该怎么做?
c# ×1