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")
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")
Session.Contents(x)에서 x를 각각 반복합니다
 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)
Session.Contents(x)에서 x를 각각 반복합니다
 Response.Write(x & "=" & Session.Contents(x) & "<br />")
다음
%>

출력:

test1=First test
test3=Third test

Application 객체 참조 가이드