ASP Count 属性

定义和用法

Count 属性返回在 Dictionary 对象中 key/item 对的数目。

语法:

  1. DictionaryObject.Count

实例

  1. <%
  2. dim d
  3. set d=Server.CreateObject("Scripting.Dictionary")
  4. d.Add "c","China"
  5. d.Add "i","Italy"
  6. d.Add "s","Sweden"
  7. Response.Write("The number of key/item pairs: " & d.Count)
  8. set d=nothing
  9. %>

输出:

  1. The number of key/item pairs: 3