ASP Exists ·½·¨

¶¨ÒåºÍÓ÷¨

Exists ·½·¨·µ»ØÔÚ Dictionary ¶ÔÏóÖÐÊÇ·ñ´æÔÚÖ¸¶¨µÄ key µÄ²¼¶ûÖµ¡£Èç¹û´æÔÚ£¬·µ»Ø true£¬·ñÔò·µ»Ø false¡£

Óï·¨£º

DictionaryObject.Exists(key)
²ÎÊý ÃèÊö
key ±ØÐèµÄ¡£ÐèËÑË÷µÄ key Öµ¡£

ʵÀý

<%
dim d
set d=Server.CreateObject("Scripting.Dictionary")
d.Add "c","China"
d.Add "i","Italy"
d.Add "s","Sweden"

if d.Exists("c")=true then
  Response.Write("Key exists!")
else
  Response.Write("Key does not exist!")
end if

set d=nothing
%>

Êä³ö£º

Key exists!
VUE