문제

Is there a way to get something like the Type.AssemblyQualifiedName property, which differentiates between a List of strings and a List of bytes, from a System.Reflection.FieldInfo?

The FieldInfo.GetFullName() method doesn't differentiate between the 2, and I need to be able to get the offset of a field, and still differentiate between List of strings and a List of bytes.

도움이 되었습니까?

해결책

You could access the field's type by looking at the FieldType property of your FieldInfo object.

EDIT

I stand corrected. Type.Name will not do what you want. You could use Type.AssemblyQualifiedName as you suggest or you could access the types directly by looking at the result of Type.GetGenericArguments().

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top