当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP Exists 方法

ASP
ASP Drive
ASP File
ASP Folder
ASP Dictionary
ASP ADO
ASP AdRotator
ASP BrowserCap
ASP Content Linking
ASP Content Rotator
ASP Quick Ref
ASP 摘要
ASP 实例

ASP Exists 方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 322 ::
收藏到网摘: n/a

The Exists method returns a Boolean value that indicates whether a specified key exists in the Dictionary object. It returns true if the key exists, and false if not.
ASP Exists的作用是判断字典对象中是否存在指定的关键词。如果存在,则返回true逻辑真;如果不存在,则返回false逻辑假。

Syntax
语法

DictionaryObject.Exists(key)

Parameter参数 Description描述
key Required. The key value to search for
必要参数。具体需要查找的关键词的值

Example
举例

<%
dim d
set d=Server.CreateObject("Scripting.Dictionary")
d.Add "n","Norway"
d.Add "i","Italy"
d.Add "s","Sweden"
if d.Exists("n")=true then Response.Write("Key exists!")
else Response.Write("Key does not exist!")
end if
set d=nothing
%>

Output:

Key exists!

评论 (0) All

登陆 | 还没注册?