1、存在 dim d
set d=Server.CreateObject("Scripting.Dictionary")
d.Add "c", "China"
d.Add "i", "Italy"
if d.Exists("c")= true then
Response.Write("键存在。")
else
Response.Write("键不存在。")
end if
set d=nothing 2、遍历值
a=d.Items
for i = 0 To d.Count -1
s = s & a(i) & "<br />"
next
Response.Write(s) 3、遍历主键 a=d.Keys
for i = 0 To d.Count -1
s = s & a(i) & "<br />"
next
Response.Write(s) 4、返回值 d.Add "c", "China"
d.Add "i", "Italy"
Response.Write("项目 i 的值是:" & d.item("i")) 5、修改主键 d.Add "c", "China"
d.Add "i", "Italy"
d.Key("i") = "it"
Response.Write("键 i 已设置为 it,其值是:" & d.Item("it")) 6、返回数量 d.Count 7、删除 DictionaryObject.Remove(key) DictionaryObject.RemoveAll