ASP Contents.RemoveMéthode
Référence complète de l'objet Session
La méthode Contents.Remove supprime un élément de la collection Contents.
Syntaxe
Application.Contents.Remove(name|index)
Session.Contents.Remove(name|index)
Session.Contents.Remove(name|index)
| Parameters | Description |
|---|---|
| name | Le nom de l'élément à supprimer. |
| index | Le numéro d'index de l'élément à supprimer. |
Exemple pour l'objet Application
Exemple 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
%>
Sortie :
test1=First test
test3=Troisième test
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
%>
Sortie :
test1=First test
test3=Troisième test
Exemple 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
%>
Sortie :
test1=First test
test3=Troisième test
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
%>
Sortie :
test1=First test
test3=Troisième test
Exemple pour l'objet Session :
Exemple 1
<%
Session("test1")=("Premier test")
Session("test2")=("Deuxième test")
Session("test3")=("Troisième test")
Session.Contents.Remove("test2")
for each x in Session.Contents
Response.Write(x & "=" & Session.Contents(x) & "<br>")
next
%>
Sortie :
test1=First test
test3=Troisième test
Session("test1")=("Premier test")
Session("test2")=("Deuxième test")
Session("test3")=("Troisième test")
Session.Contents.Remove("test2")
for each x in Session.Contents
Response.Write(x & "=" & Session.Contents(x) & "<br>")
next
%>
Sortie :
test1=First test
test3=Troisième test
Exemple 2
<%
Session("test1")=("Premier test")
Session("test2")=("Deuxième test")
Session("test3")=("Troisième test")
Session.Contents.Remove(2)
for each x in Session.Contents
Response.Write(x & "=" & Session.Contents(x) & "<br>")
next
%>
Sortie :
test1=First test
test3=Troisième test
Session("test1")=("Premier test")
Session("test2")=("Deuxième test")
Session("test3")=("Troisième test")
Session.Contents.Remove(2)
for each x in Session.Contents
Response.Write(x & "=" & Session.Contents(x) & "<br>")
next
%>
Sortie :
test1=First test
test3=Troisième test
Référence complète de l'objet Session Autres extensions