Public Sub Add(ByVal phone As String, ByVal name As String)
MyBase.InnerHashtable.Add(phone, name)
End Sub
'--Subroutine to extract the value from a dictionary when the key is passed as input
Public Function Item(ByVal phone As String) As String
Return CStr(MyBase.InnerHashtable.Item(phone))
End Function
サンプルエントリで辞書を見上げて:私は辞書の逆引き参照のための助けを必要キー(VB.NET
'--Adding key and values to the dictionary
myDict.Add("6812036998", "Horton")
myDict.Add("6812036999", "Olive")
私は名前を見つけることができるはずですkey
考えるしかし、私。それは間違っていると文句を言わない仕事下記のコード
Public Function lookupValue(ByVal name As String)
Return CStr(MyBase.InnerHashtable.Item(name))
End Function
は、なぜあなたはNAME' '検索したい場合は 終了すでに 'name'が与えられている場合は' Dictionary'に入れます。あるいは、 'key'を与えられたときに' name'を見つけたいと思うでしょうか? – jamiedanq