Latest web development tutorials

ASP Count 屬性

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

Count 屬性返回在Dictionary 對像中key/item 對的數目。

語法

DictionaryObject.Count

實例

<%
dim d
set d=Server.CreateObject("Scripting.Dictionary")
d.Add "n","Norway"
d.Add "i","Italy"
d.Add "s","Sweden"
Response.Write("The number of key/item pairs: " & d.Count)
set d=nothing
%>

输出:

The number of key/item pairs: 3


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