返回一个所有键的数组

代码:

<!DOCTYPE html>

<html>

<body>

 

<%

dim d,a,i,s

set d=Server.CreateObject("Scripting.Dictionary")

d.Add "n", "Norway"

d.Add "i", "Italy"

Response.Write("<p>The value of the keys are:</p>")

a=d.Keys

for i = 0 To d.Count -1

    s = s & a(i) & "<br>"

next

Response.Write(s)

set d=nothing

%>

 

</body>

</html>

结果:

The value of the keys are:

n
i

相关文章