วิธีการ ASP

การระบุและวิธีใช้

วิธีการใช้งานของเมธอด Keys คือ การกลับค่าแบบ Array ที่มีค่าทุกคำศัพท์ใน Dictionary ของ Object

ระบุรายละเอียด

DictionaryObject.Keys

ตัวอย่าง

<%
dim d,a,i
set d=Server.CreateObject("Scripting.Dictionary")
d.Add "c","China"
d.Add "i","Italy"
d.Add "s","Sweden"
Response.Write("<p>Key values:</p>")
a=d.Keys
for i=0 to d.Count-1
  Response.Write(a(i))
  Response.Write("
") next set d=nothing %>

输出:

Key values:
c
i
s