已经解决,在窗体里画个命令按钮,双击命令按钮,把以下代码粘贴→调试→启动调试→点击命令按钮,ok.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer = 0, s As String = ""
Dim a() As Integer = {11, 22, 11, 11, 8, 9, 6, 8, 9}
Dim d = CreateObject("Scripting.Dictionary")
For i = LBound(a) To UBound(a)
d(a(i)) = d(a(i)) + 1
Next
Dim arr = d.keys
Dim brr = d.items
' MsgBox(brr(0))
' MsgBox(d.count)
For i = 0 To d.count - 1
s = s & arr(i) & "
个数
" & brr(i) & Chr(10)
Next
MsgBox(s)
End Sub
End Class