TUTORIALBackendFETCHED

ASP Add 方法

ASP Add 方法 完整的 Dictionary 对象参考手册 Add 方法向 Dictionary 对象添加一个新的 key/item 对。 注意:如果 key 已经存在,则会出现错误。 语法 DictionaryObject.Add(key,item) 参数 描述 key 必需的。与 item 相关联的 key 值。 item 必需的..

Updated 7/16/2026

Tutorial detail pages default to noindex.

ASP Add 方法


Dictionary 对象参考手册 完整的 Dictionary 对象参考手册

Add 方法向 Dictionary 对象添加一个新的 key/item 对。

注意:如果 key 已经存在,则会出现错误。

语法

DictionaryObject.Add(key,item)

参数 描述
key 必需的。与 item 相关联的 key 值。
item 必需的。与 key 相关联的 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 对象参考手册 完整的 Dictionary 对象参考手册