طريقة ASP Contents.Remove

دليل مرجع عنصر Application

يستخدم طريقة Contents.Remove لإزالة عنصر من مجموعة Contents.

النحو

Application.Contents.Remove(name|index)
Session.Contents.Remove(name|index)
المتغيرات وصف
name اسم العنصر الذي سيتم حذفه.
index رقم مؤشر العنصر الذي سيتم حذفه.

للنماذج من Application

مثال 1

<%
Application("test1")=("First test")
Application("test2")=("Second test")
Application("test3")=("Third test")
Application.Contents.Remove("test2")
للمسلسل x في Application.Contents
 Response.Write(x & "=" & Application.Contents(x) & "<br />")
بعد
%>

خروجی:

test1=First test
test3=Third test

مثال 2

<%
Application("test1")=("First test")
Application("test2")=("Second test")
Application("test3")=("Third test")
Application.Contents.Remove(2)
للمسلسل x في Application.Contents
 Response.Write(x & "=" & Application.Contents(x) & "<br />")
بعد
%>

خروجی:

test1=First test
test3=Third test

للنماذج من Session

مثال 1

<%
Session("test1")=("First test")
Session("test2")=("Second test")
Session("test3")=("Third test")
Session.Contents.Remove("test2")
برای هر x در Session.Contents
 Response.Write(x & "=" & Session.Contents(x) & "<br />")
بعد
%>

خروجی:

test1=First test
test3=Third test

مثال 2

<%
Session("test1")=("First test")
Session("test2")=("Second test")
Session("test3")=("Third test")
Session.Contents.Remove(2)
برای هر x در Session.Contents
 Response.Write(x & "=" & Session.Contents(x) & "<br />")
بعد
%>

خروجی:

test1=First test
test3=Third test

دليل مرجع عنصر Application