📜  ASP 项目方法

📅  最后修改于: 2022-05-13 01:56:52.951000             🧑  作者: Mango

ASP 项目方法

ASP Items Method用于返回当前在 Dictionary 对象中的所有项目的数组。

句法:

DictionaryObject.Items

示例:下面的代码演示了 ASP Dictionary.Items 方法。

ASP
<%
dim dict,arr,i
set dict=Server.CreateObject("Scripting.Dictionary")
  
'Add values to the dictionary
dict.Add "g","geeks"
dict.Add "c","coding" 
dict.Add "p","placements"
  
'Getting the items of the dictionary
arr=dict.Items
  
Response.Write("The values in the dictionary are:")
  
'Looping through the items
for i=0 to dict.Count-1
  Response.Write("
Value: " & arr(i)) next    set dict=nothing %>


输出:

The values in the dictionary are:
Value: geeks
Value: coding
Value: placements