Public Class NameInfo
Public Property NAME() As String
Get
Return m_NAME
End Get
Set
m_NAME = Value
End Set
End Property
Private m_NAME As String
Public Property GENER() As String
Get
Return m_GENER
End Get
Set
m_GENER = Value
End Set
End Property
Private m_GENER As String
Public Property AGE() As Integer
Get
Return m_AGE
End Get
Set
m_AGE = Value
End Set
End Property
Private m_AGE As Integer
End Class
Private Sub Main(args As String())
' Create List
Dim ls = New List(Of NameInfo)()
' Add Item
ls.Add(New NameInfo() With { _
.NAME = "Weerachai Nukitram", _
.GENER = "Male", _
.AGE = 34 _
})
ls.Add(New NameInfo() With { _
.NAME = "Wisarut Nukitram", _
.GENER = "Male", _
.AGE = 40 _
})
ls.Add(New NameInfo() With { _
.NAME = "Wipa Nukitram", _
.GENER = "Female", _
.AGE = 18 _
})
' Loop
For Each item In ls
'Console.WriteLine(string.Format("{0}, {1}, {2}", item.NAME, item.GENER, item.AGE));
Console.WriteLine(item.NAME + ", " + item.GENER + ", " + item.AGE)
Next
End Sub