Latest web development tutorials

ASP Item 屬性

Dictionary 對象參考手冊 完整的Dictionary對象參考手冊

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 pi is: " & d.Item("pi"))
%>

输出:

The value of key pi is: Pink


Dictionary 對象參考手冊 完整的Dictionary對象參考手冊