Występuje metody ASP
Istnieje metoda zwraca wartość logiczną, która jest wartością logiczną wskazującą, czy określony klucz istnieje w obiekcie Dictionary. Jeśli nie jest, to zwraca wartość true, w przeciwnym razie zwraca false.
gramatyka
DictionaryObject.Exists(key)
参数 | 描述 |
---|---|
key | 必需的。要搜索的 key 值。 |
Przykłady
<%
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!
Kompletny słownik Object Reference