www.baike369.com
百科369 > ASP教程 > ASP Dictionary对象RemoveAll方法

ASP Dictionary对象RemoveAll方法


ASP Dictionary对象RemoveAll方法

ASP的RemoveAll方法主要从Dictionary对象中删除所有的key/item对。


语法

DictionaryObject.RemoveAll

示例

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<title>ASP Dictionary对象RemoveAll方法示例-www.baike369.com</title>
</head>
<body>
<%
dim a,b,i
set a=Server.CreateObject("Scripting.Dictionary")
a.Add "r","Red"
a.Add "g","Green"
a.Add "b","Blue"

a.RemoveAll

Response.Write("<p>Key的值为:</p>")
b=a.Keys

for i=0 to a.Count-1
  Response.Write(b(i))
  Response.Write("<br />")
next
set a=nothing
%>
</body>
</html>

在浏览器中查看ASP Dictionary对象RemoveAll方法的显示效果。如下图所示:

在浏览器中查看ASP Dictionary对象RemoveAll方法的显示效果

Key的值为空。

Copyright© 2011-2016 www.baike369.com All Rights Reserved