مетод ASP Contents.Remove
مетод Contents.Remove یک مورد را از مجموعه Contents حذف میکند.
قواعد دستور زبان
Application.Contents.Remove(name|index) Session.Contents.Remove(name|index)
پارامتر | توضیحات |
---|---|
name | نام پروژهای که باید حذف شود. |
index | شماره شاخص پروژهای که باید حذف شود. |
مثال برای Application Object:
مثال 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 />") next %>
خروجی:
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 />") next %>
خروجی:
test1=First test test3=Third test
مثال برای Session Object:
مثال 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 />") next %>
خروجی:
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 />") next %>
خروجی:
test1=First test test3=Third test