一个用application存数组的例子
来源:互联网 发布:安庆网络广播节目点播 编辑:程序博客网 时间:2024/05/16 10:20
<% Application("StoredArray")(3) = "new value" %>
This is because the Application object is implemented as a collection. The array element StoredArray(3) does not receive the new value. Instead, the value would be included in the Application object collection, and would overwrite any information that had previously been stored at that location.
It is strongly recommended that if you store an array in the Application object, you retrieve a copy of the array before retrieving or changing any of the elements of the array. When you are done with the array, you should store the array in the Application object again, so that any changes you made are saved. This is demonstrated in the following scripts.
---file1.asp---
<%
'Creating and initializing the array.
dim MyArray()
Redim MyArray(5)
MyArray(0) = "hello"
MyArray(1) = "some other string"
'Storing the array in the Application object.
Application.Lock
Application("StoredArray") = MyArray
Application.Unlock
Server.Transfer("file2.asp")
%>
---file2.asp---
<%
'Retrieving the array from the Application Object
'and modifying its second element.
LocalArray = Application("StoredArray")
LocalArray(1) = " there"
'Printing out the string "hello there."
Response.Write(LocalArray(0)&LocalArray(1))
'Re-storing the array in the Application object.
'This overwrites the values in StoredArray with the new values.
Application.Lock
Application("StoredArray") = LocalArray
Application.Unlock
%>
- 一个用application存数组的例子
- 一个用application存数组的例子
- 一个数组使用的例子
- 关于数组的一个例子
- 一个通过自定义application管理安卓activity的例子
- 做一个返回数组的函数(例子)
- 一个oracle函数返回数组的例子
- 做一个返回数组的函数(例子)
- 一个C++数组指针的例子
- 自定义规则排序数组的一个例子
- 指针和数组的一个例子
- 一个例子解释“数组名"的含义
- 一个关于指针数组的例子
- 数组和指针的一个例子
- 一个动态数组的例子C++
- 把二维数组存到数据库的一个字段中
- 电子圈存的秘密——去中心化的一个例子
- 将两个已经排好序的数组重新排序存于一个更大的数组中
- VC++调用Web Service的方法及注意事项
- 在ASP.NET里得到包含汉字的字符串长度
- XML Web Service
- ASP.NET TreeView操作实例(代码调试通过)
- 常用DOS批处理命令
- 一个用application存数组的例子
- 缓冲区溢出攻防-『局部变量』
- 佛解的爱
- 找工作经历--生活的味道都在里面
- asp.net轮换广告控件(c#)
- 一篇评论新浪与博客的妙文
- C#.Net的常见面试试题(3)
- 电话按键原理
- Clavio