Convert FieldInfo to Dictionary
C#
3
Posts
2
Posters
0
Views
1
Watching
-
Hi, How can converty the FieldInfo to Dictionary ? my code : fieldInfo = this.GetType().GetField("dictionary1"); Dictionary dic2 = (Dictionary)fieldInfo; The second line is wrong. Thanks Wilson
Hi, assuming your field is really of type Dictionary then:
Dictionary dic2 = (Dictionary)fieldInfo.GetValue(this)
-
Hi, assuming your field is really of type Dictionary then:
Dictionary dic2 = (Dictionary)fieldInfo.GetValue(this)