TimHudspith
asked on
Iterate a structure to get the names and values of its members
I want to iterate a structure in order to build a string out of the name and value of its members. The following code seems to be what I need but the .GetValue method expects an object parameter that I don't understand:
Dim sb As New System.Text.StringBuilder
Dim t As Type = GetType(myStructure)
For Each f As System.Reflection.FieldInfo In t.GetFields
sb.AppendLine(f.Name & " = " & f.GetValue(??) & ", ")
Next f
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER