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

ASP
ASP 介绍
ASP Install
ASP 语法
ASP 变量
ASP Procedures
ASP Forms
ASP Cookies
ASP Session
ASP Application
ASP #include
ASP Global.asa
ASP Send e-mail
ASP Response
ASP Request
ASP Application
ASP Session
ASP Server
ASP Error
ASP FileSystem
ASP TextStream

ASP Exists 方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 321 ::
收藏到网摘: 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

登陆 | 还没注册?