ASP Add 方法
完整的 Dictionary 對象參考手冊
Add 方法向 Dictionary 對象添加一個新的 key/item 對。
注意:如果 key 已經(jīng)存在,則會出現(xiàn)錯誤。
語法
DictionaryObject.Add(key,item)
參數(shù) | 描述 |
key | 必需的。與 item 相關聯(lián)的 key 值。 |
item | 必需的。與 key 相關聯(lián)的 item 值。 |
實例
<%
Dim d
Set d=Server.CreateObject("Scripting.Dictionary")
d.Add "re","Red"
d.Add "gr","Green"
d.Add "bl","Blue"
d.Add "pi","Pink"
Response.Write("The value of key gr is: " & d.Item("gr"))
%>
輸出:
The value of key gr is: Green
完整的 Dictionary 對象參考手冊
更多建議: