企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
| JScript  | [语言参考](#) | |-----|-----| # Exists 方法 如果 **Dictionary** 对象中存在所指定的主键则返回 **true**,否则返回 **false**。 `*object***.Exists(***key***)** ` #### 参数 object 必选项。总是一个 **Dictionary** 对象的名称。 key 必选项。需要在 **Dictionary** 对象中搜索的 *key* 值。 下面这个例子说明了 **Exists** 方法的用法。 ~~~ function keyExists(k) { ~~~     ~~~ var fso, s = ""; ~~~ ~~~    d = new ActiveXObject("Scripting.Dictionary"); ~~~ ~~~    d.Add("a", "Athens"); ~~~ ~~~    d.Add("b", "Belgrade"); ~~~ ~~~    d.Add("c", "Cairo"); ~~~ ~~~    if (d.Exists(k)) ~~~ ~~~       s += "Specified key exists."; ~~~ ~~~    else ~~~ ~~~       s += "Specified key doesn't exist."; ~~~ ~~~    return(s); ~~~ } #### 请参阅 [Add 方法 (Dictionary)](#) | [Items 方法](#) | [Keys 方法](#) | [Remove 方法](#) | [RemoveAll 方法](#)应用于: [Dictionary 对象](#) [© 2000 Microsoft Corporation 版权所有。保留所有权利。使用规定。](#)