Añadir ASP Método
Añadir método para agregar un nuevo par de claves / elemento a un objeto Dictionary.
Nota: Si laclave ya existe, se produce un error.
gramática
DictionaryObject.Add(key,item)
参数 | 描述 |
---|---|
key | 必需的。与 item 相关联的 key 值。 |
item | 必需的。与 key 相关联的 item 值。 |
Ejemplos
<%
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
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
Completo diccionario de referencia de objetos