当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP Add 方法

ASP
ASP Drive
ASP File
ASP Folder
ASP Dictionary
ASP ADO
ASP AdRotator
ASP BrowserCap
ASP Content Linking
ASP Content Rotator
ASP Quick Ref
ASP 摘要
ASP 实例

ASP Add 方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 274 ::
收藏到网摘: n/a

The Add method adds a new key/item pair to a Dictionary object.
ASP Add的作用是将一个新的关键词/元素组对(key/item pair)添加到一个字典对象中。

Syntax
语法

DictionaryObject.Add(key,item)

Parameter参数 Description描述
key Required. The key value associated with the item
必要参数。具体指与元素相关联的关键词的值
item Required. The item value associated with the key
必要参数。具体指与关键词相关联的元素的值

Example
举例

<%
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 

评论 (0) All

登陆 | 还没注册?