<分区>
Possible Duplicate:
Reflection - Getting the generic parameters from a System.Type instance
Get actual type of T in a generic List<T>
我正在循环访问类中的 PropertyInfo-List。
在这门课中,我对不同的列表感兴趣——例如 List<int>
, List<string>
, List<Book>
, aso.
但我不知道如何获得列表对象的类型。我只是得到类似的东西
System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089]].
我可以将这些信息分开并从这些信息中创建一个类型,但我希望有更顺畅的方法吗?