Latest web development tutorials

ASP Key 屬性

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

Key 屬性在Dictionary 對像中為已有的key 設置新值。

語法

DictionaryObject.Key(key)=newkey

参数 描述
key 必需的。需修改的 key 的名称。
newkey 必需的。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"
d.Key("re")="r"
Response.Write("The value of key r is: " & d.Item("r"))
%>

输出:

The value of key r is: Red


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