当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP Add 方法
The Add method adds a new key/item pair to a Dictionary object.
ASP Add的作用是将一个新的关键词/元素组对(key/item pair)添加到一个字典对象中。
DictionaryObject.Add(key,item) |
Parameter参数 | Description描述 |
---|---|
key | Required. The key value associated with the item 必要参数。具体指与元素相关联的关键词的值 |
item | Required. The item value associated with the key 必要参数。具体指与关键词相关联的元素的值 |
<% 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")) %> Output: The value of key gr is: Green |