ASP Item 屬性

定義和用法

Item 屬性設置或返回 Dictionary 對象中某個項目的值。

語法:

DictionaryObject.Item(key)[=newitem]
參數 描述
key 必需的。與 item 相關聯的 key。
newitem 可選的。規定與 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 bl is: " & d.Item("bl"))
%>

輸出:

The value of key bl is: Blue