Metoda ASP Contents.Remove

Podręcznik referencyjny obiektu Application

Metoda Contents.Remove usuwa element z kolekcji Contents.

Gramatyka

Application.Contents.Remove(name|index)
Session.Contents.Remove(name|index)
Parametry Opis
name Nazwa elementu do usunięcia.
index Indeks elementu do usunięcia.

Przykład dla obiektu Application

Przykład 1

<%
Application("test1")=("First test")
Application("test2")=("Second test")
Application("test3")=("Third test")
Application.Contents.Remove("test2")
for each x in Application.Contents
 Response.Write(x & "=" & Application.Contents(x) & "<br />")
next
%>

Wynik:

test1=Pierwszy test
test3=Trzeci test

Przykład 2

<%
Application("test1")=("First test")
Application("test2")=("Second test")
Application("test3")=("Third test")
Application.Contents.Remove(2)
for each x in Application.Contents
 Response.Write(x & "=" & Application.Contents(x) & "<br />")
next
%>

Wynik:

test1=Pierwszy test
test3=Trzeci test

Przykład dla obiektu Session:

Przykład 1

<%
Session("test1")=("First test")
Session("test2")=("Second test")
Session("test3")=("Third test")
Session.Contents.Remove("test2")
for each x in Session.Contents
 Response.Write(x & "=" & Session.Contents(x) & "<br />")
next
%>

Wynik:

test1=Pierwszy test
test3=Trzeci test

Przykład 2

<%
Session("test1")=("First test")
Session("test2")=("Second test")
Session("test3")=("Third test")
Session.Contents.Remove(2)
for each x in Session.Contents
 Response.Write(x & "=" & Session.Contents(x) & "<br />")
next
%>

Wynik:

test1=Pierwszy test
test3=Trzeci test

Podręcznik referencyjny obiektu Application