当前位置:K88软件开发文章中心编程语言AspAsp01 → 文章内容

asp session 使用数组

减小字体 增大字体 作者:佚名     来源:asp编程网  发布时间:2018-12-30 8:31:34

Dim 
MyArray() 

Redim 
MyArray(5) 

Session("
StoredArray"


MyArray 

用的时候这样:LocalArray 

Session("
StoredArray"


LocalArray(1) 

"
 
there"
 

Response.Write(LocalArray(0)&

#38
LocalArray(1)) 


又例如:


<


&
#39
建立并初始化数组
dim 
myarray() 

redim 
myarray(5) 

myarray(0)="
 
www.aspprogram.cn"

myarray(1)="
这里是asp编程网 
"

session("
storedarray"
)=myarray

response.redirect("
2.asp"


%>


---2.asp--- 

<


&
#39
从session中取出数组的值 
并更新第二个元素
localarray=session("
storedarray"


localarray(1)="
there&
#39
printingoutthestringhellothere."
 

response.write(localarray(0)&

#38
localarray(1))

&
#39
下面的一行代码将session中保留的数组更新
session("
storedarray"
)="
localarray 
"

%>




asp session 使用数组