VB 基础语法 ArrayList

VB 基础语法 ArrayList

Public Class frmMain

    Private Sub btnTest_Click(sender As Object, e As EventArgs) Handles btnTest.Click
        Dim name As String
        Dim age As Integer
        Dim i As Integer
        Dim user As ArrayList

        user = New ArrayList()

        For i = 1 To 3
            user.Add("user" + i.ToString())

            If i = 1 Then
                MsgBox("a" + i.ToString())
            Else
                MsgBox(i.ToString())
            End If

        Next

        name = "jzh"
        age = 35
        MsgBox(name + " " + age.ToString())

        For i = 0 To user.Count - 1
            MsgBox(user.Item(i))
        Next

    End Sub
End Class

 

发表回复

您的电子邮箱地址不会被公开。