Così:
Public Structure Struttura
Public primo As String
Public secondo As Integer
Public terzo As Double
End Structure
Protected Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Dim istanza As New Struttura
istanza.primo = "Nome Cognome"
istanza.secondo = 6
istanza.terzo = 6.5
Dim Infos() As FieldInfo
Infos = istanza.GetType.GetFields
Dim nome As String
Dim tipo As Type
Dim valore As Object
For Each fi As FieldInfo In Infos
nome = fi.Name
tipo = fi.FieldType
valore = fi.GetValue(istanza)
Next
End Sub
in ogni ciclo legge una variabile, il suo nome, il tipo e il valore.
Non avevo capito che GetValue richiedeva l'istanza come parametro.

Rispondi quotando
