Public Class Form1 Private Sub Form1_Click(sender As Object,e As EventArgs) Handles Me.Click Dim K(3,4) As Integer TextBox1.Text = K.Length '获取整个数组的长度"Length" TextBox2.Text = K.GetLength(0) '获取第一维数组的长度"GetLength(0)" TextBox3.Text = K.GetLength(1) '获取第二维数组的长度"GetLength(1)" End Sub End Class
运行结果如下: