ASP Contents.Remove メソッド

Application オブジェクトリファレンスマニュアル

Contents.Remove メソッドは Contents コレクションから1つの項目を削除します。

文法

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")
for each x in 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)
for each x in 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")
for each x in 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)
for each x in Session.Contents
 Response.Write(x & "=" & Session.Contents(x) & "<br />")
次へ
%>

出力:

test1=First test
test3=Third test

Application オブジェクトリファレンスマニュアル