如何在ASP中创建键/值对?

时间:2010-09-06 08:19:00

标签: asp-classic vbscript

如何在ASP / VBScript中执行此类操作?

Dim pairs
pairs= Dictionary(String, Integer)()
For Each item As String In storage
    Dim temp
    temp = item.Split(".")
    pairs.Add(temp(0), temp(1))
Next

1 个答案:

答案 0 :(得分:3)

使用“Scripting.Dictionary”对象,如下所示:

set objPairs = Server.CreateObject("Scripting.Dictionary")
objPairs.add temp(0), temp(1)