当前位置: 首页 > 图文教程 > 网络编程 > ASP > asp session 使用数组

ASP
ASP编程中15个非常有用的例子 (二)
ASP与JSP的比较(一)
ASP与JSP的比较(二)
ASP中五种连接数据库的方法
从ASP调用SQL中的图像
用排序串字段实现树状结构(例程:连接字串)
用排序串字段实现树状结构(例程:删除贴子)
用排序串字段实现树状结构(例程:回复表单)
用排序串字段实现树状结构(例程:显示贴子内容)
用排序串字段实现树状结构(例程:显示树)
用排序串字段实现树状结构(存储过程)
用排序串字段实现树状结构(库结构)
用排序串字段实现树状结构(原理)
remote script文档(转载自微软)(一)
remote script文档(转载自微软)(二)
remote script文档(转载自微软)(三)
remote script文档(转载自微软)(四)
remote script文档(转载自微软)(五)
remote script文档(转载自微软)(六)
remote script文档(转载自微软)(七)

ASP 中的 asp session 使用数组


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

Dim MyArray() 
Redim MyArray(5) 
Session("StoredArray") = MyArray 
用的时候这样:LocalArray = Session("StoredArray") 
LocalArray(1) = " there" 
Response.Write(LocalArray(0)&LocalArray(1)) 

又例如:


<% 
'建立并初始化数组
dim myarray() 
redim myarray(5) 
myarray(0)=" www.aspprogram.cn"
myarray(1)="这里是asp编程网 "
session("storedarray")=myarray

response.redirect("2.asp") 
%>

---2.asp--- 
<% 
'从session中取出数组的值 并更新第二个元素
localarray=session("storedarray") 
localarray(1)="there'printingoutthestringhellothere." 
response.write(localarray(0)&localarray(1))

'下面的一行代码将session中保留的数组更新
session("storedarray")="localarray "
%>