''''''''''''''''''''''''''''''''''''''''
'Dictionary 键值对 ,'主要属性Key,Item,Count,'主要方法Add、Exists、Items、Keys、Remove、RemoveAll。''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Add 用法'object.Add key,item'释:向Dictionary添加项'注:key 唯一''''''''''''''''''''''''''''''''''''''''Dim d '定义变量Set d =CreateObject("Scripting.Dictionary") '创建Dictionary 对象 d.Add "a","Athens" d.Add "b","Belgrade"d.Add "c","Cairo"'''''''''''''''''''''''''''''''''
'遍历输出key,item'遍历对象Dictionary''''''''''''''''''''''''''''''''''遍历keyFor Each its In d.Keys MsgBox itsNext'遍历item
For Each its In d.Items MsgBox itsNext''''''''''''''''''''''''''
'Exists 用法'Exists(key)'释:判断Dictionary指定的键是否存在'注:key为指定的键值'''''''''''''''''''''''''''判断Key值是否存在If d.Exists("d") Then msg="Exists"Else msg="Not Exists"End If MsgBox msg''''''''''''''''''''''''''
'Remove 用法'object.Remove(key)'释:移除指定key的键值对'注:如果key不存在会出现错误''''''''''''''''''''''''''a=d.Remove("a")MsgBox aFor Each its In dMsgBox itsNext'''''''''''''''''''''''''
'附:修改键,值'''''''''''''''''''''''''d.item("b")="bb"For Each its In dMsgBox d.Item(its)Nextd.Key("b")="d"
For Each its In dMsgBox itsNext''''''''''''''''''''''''''
'RemoveAll 用法+Count'object.RemoveAll'释:删除Dictionary所有键值对''''''''''''''''''''''''''MsgBox d.Countd.RemoveAllFor Each its In dMsgBox itsNext MsgBox d.Count