ASP existe método
Existe método devuelve un valor booleano, que es un valor booleano que indica si la clave especificada existe en el objeto Dictionary. Si existe, devuelve true, en caso contrario devuelve false.
gramática
DictionaryObject.Exists(key)
参数 | 描述 |
---|---|
key | 必需的。要搜索的 key 值。 |
Ejemplos
<%
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
%>
输出:
Key exists!
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
%>
输出:
Key exists!
Completo diccionario de referencia de objetos