当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP Contents.Remove 方法
The Contents.Remove method deletes an item from the Contents collection.
ASP Contents.Remove方法的作用是删除Contents集合中的一个项目。
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 删除项目索引 |
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 |
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 |