以下のコードを見て、誰かが私を助けることができます....
public class person
{
Public string name { get; set; };
Public personDetails Pdetails { get; };
}
public class personDetails
{
Public bool hasChild { get; set; }
Public string ChildName { get; set; }
}
static void Main(string[] args)
{
Type type = asm.GetType(person);
object classInstance = Activator.CreateInstance(type);
PropertyInfo prop = type.GetProperty("Pdetails ", BindingFlags.Public | BindingFlags.Instance);
if (null != prop && prop.CanWrite)
{
prop.SetValue(classInstance, null , null);
}
}
プロパティの取得エラーが見つかりません。