反射不大会 所以请教各位
我想反射一个dll 这个dll中有个方法 返回了一个 List 集合
然后我该怎样写反射代码获取这个List呢。
下面是dll中代码
Type type = sam.GetType("demoinfo.dll",ture,ture);
List infoList = type.TengXunContent();
这样写试试。
还有个问题 就是 dll中代码是
我现在反射这个dll 然后我怎么将 这个var Info 存到List集合呢
Type type = sam.GetType("TengXun.demoinfo.dll",ture,ture);
Type type = typeof(Info);
List<Info> inf = newList<Info>();
foreach (System.Reflection.PropertyInfo info in type.GetProperties())
{
info.SetValue(inf, info.GetValue(c1, null), null);
}
这样试试,我还没有验证。