Imports System.Collections.Generic Public Class MyDictionary Public dict As New Dictionary(Of String, String) Public Sub New() dict.Add("001", "aaa") dict.Add("002", "bbb") dict.Add("003", "ccc") '… End Sub End Class
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim id As String Dim item As New MyDictionary id = item.dict("001") MsgBox(id) End Sub End Class