Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
通常工作我得到一个PropertyInfo方法一个属性,这个属性将永远是一个
PropertyInfo
Dictionary<someobject, customenum>我需要通过这个属性知道什么类型的键(someobject)......
Dictionary<someobject, customenum>
谁能帮我?
抱歉英语不是我的母语!
我想这就是你想要的:
var d = new Dictionary<int, string>(); var arguments = d.GetType().GetGenericArguments(); var keyType = arguments[0]; var valueType = arguments[1];