1
我有這個非常簡單的測試,因爲完整版本不工作;C#反射代碼不起作用;
public class dfd
{
public string g { get; set; }
}
然後;
Type myType = typeof(dfd);
FieldInfo[] b = myType.GetFields(BindingFlags.Public);
當我看b時,沒有字段信息。
{System.Reflection.FieldInfo[0]}
任何想法?
是的,我只是意識到,當你打字我想。 :) – griegs
改爲使用PropertyInfo。似乎更有意義。 – griegs