当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP Contents.Remove 方法

ASP
ASP Drive
ASP File
ASP Folder
ASP Dictionary
ASP ADO
ASP AdRotator
ASP BrowserCap
ASP Content Linking
ASP Content Rotator
ASP Quick Ref
ASP 摘要
ASP 实例

ASP Contents.Remove 方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 411 ::
收藏到网摘: n/a

The Contents.Remove method deletes an item from the Contents collection.
ASP Contents.Remove方法的作用是删除Contents集合中的一个项目。

Syntax
语法

Application.Contents.Remove(name|index)
Session.Contents.Remove(name|index)

Parameter
参数
Description
描述
name The name of the item to remove
删除项目名称
index The index of the item to remove
删除项目索引

Examples for the Application Object
Application对象举例

Example 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
%>

Output:

test1=First test
test3=Third test

Example 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
%>

Output:

test1=First test
test3=Third test

Examples for the Session Object
Session对象举例

Example 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
%>

Output:

test1=First test
test3=Third test

Example 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
%>

Output:

test1=First test
test3=Third test

评论 (0) All

登陆 | 还没注册?