?? session變量中的數組如何引用.htm
字號:
<TR bgColor=#ffcc00>
<TD align=right height=23 width=355>
<CENTER></CENTER>
<P align=center>中國動感資源交流,網絡動感資源薈萃</P></TD>
<TD align=middle>
<P align=center><A href="http://www.moonet.com/edu/">教育網</A>
英文版</P></TD></TR></TBODY></TABLE>
<CENTER>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=755>
<TBODY>
<TR vAlign=top>
<TD bgColor=#297dff width=1> </TD>
<TD width=753></TD>
<TD bgColor=#297dff width=1> </TD></TR></TBODY></TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=755>
<TBODY>
<TR vAlign=top>
<TD bgColor=#297dff width=1> </TD>
<TD width=753>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD bgColor=#297dff colSpan=2 height=20><FONT color=#ceffff> →
<A href="http://www.aspsky.net/article/index.asp?classid=2"><FONT
color=#ceffff>ASP技術</FONT></A> >> <A
href="http://www.aspsky.net/article/index.asp?classid=2&Nclassid=2"><FONT
color=#ceffff>ASP應用</FONT></A> >>
《session變量中的數組如何引用》</FONT></TD></TR>
<TR>
<TD bgColor=#586011 colSpan=2 height=1><SPACER type="block"
width="1"></TD></TR>
<TR>
<TD colSpan=2 height=7></TD></TR>
<TR>
<TD align=middle class=p4
colSpan=2><B>session變量中的數組如何引用</B></FONT><BR>2001-5-14 動網先鋒
</TD></TR>
<TR>
<TD class=p4 colSpan=2>
<BLOCKQUOTE><BR>If you store an array in a Session object, you
should not attempt to alter the elements of the stored array
directly. For example, the following script will not work:
<P></P>
<P><% Session("StoredArray")(3) = "new value" %></P>
<P>This is because the Session object is implemented as a
collection. The array element StoredArray(3) does not receive the
new value. Instead, the value is indexed into the collection,
overwriting any information stored at that location. </P>
<P>It is strongly recommended that if you store an array in the
Session 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 Session object
again so that any changes you made are saved. This is demonstrated
in the following example:</P>
<P>---file1.asp---<BR><%<BR>'Creating and initializing the
array<BR>Dim MyArray()<BR>Redim MyArray(5)<BR>MyArray(0) =
"hello"<BR>MyArray(1) = "some other string"</P>
<P>'Storing the array in the Session
object.<BR>Session("StoredArray") = MyArray</P>
<P>Response.Redirect("file2.asp")<BR>%></P>
<P>---file2.asp---<BR><%<BR>'Retrieving the array from the
Session Object<BR>'and modifying its second element.<BR>LocalArray
= Session("StoredArray")<BR>LocalArray(1) = " there"</P>
<P>'Printing out the string "hello
there."<BR>Response.Write(LocalArray(0)&LocalArray(1))</P>
<P>'Re-storing the array in the Session object.<BR>'This
overwrites the values in StoredArray with the new
values.<BR>Session("StoredArray") = LocalArray<BR>%></P>
<P><BR><BR></P></BLOCKQUOTE></TD></TR>
<TR>
<TD class=p4 vAlign=top width="50%">
<BLOCKQUOTE>原作者:hooke(轉)<BR>來 源:chinaasp<BR>共有2238位讀者閱讀過此文<BR>【<A
href="http://bbs.aspsky.net/list.asp?boardid=1">發表評論</A>】
</BLOCKQUOTE></TD>
<TD class=p4 vAlign=top width="50%">
<P>
<LI><FONT color=#0772b1>上篇文章</FONT>:<A
href="http://www.aspsky.net/article/list.asp?id=1952">怎么秋實現輸入拼音的按照漢字查詢?或輸入拼音的按照漢字查詢?</A>
<BR>
<LI><FONT color=#0772b1>下篇文章</FONT>:<A
href="http://www.aspsky.net/article/list.asp?id=1954">關于4005錯誤談我的一點經驗</A>
</LI></TD></TR>
<TR>
<TD bgColor=#297dff class=p4 height=20 width="50%"><FONT
color=#ceffff> → 本周熱門</FONT></TD>
<TD bgColor=#297dff class=p4 width="50%"><FONT color=#ceffff> →
相關文章</FONT></TD></TR>
<TR>
<TD bgColor=#586011 colSpan=2 height=1><SPACER type="block"
width="1"></TD></TR>
<TR>
<TD colSpan=2 height=7></TD></TR>
<TR>
<TD class=p4 vAlign=top width="50%">
<LI><A href="http://www.aspsky.net/article/list.asp?id=1510"
target=_top title="SQL Server 7.0 入門(一)">SQL Server 7.0
入門(...</A>[<FONT color=red>7239</FONT>]<BR>
<LI><A href="http://www.aspsky.net/article/list.asp?id=1540"
target=_top title=PHP4實際應用經驗篇(1)>PHP4實際應用經驗篇(1)</A>[<FONT
color=red>7135</FONT>]<BR>
<LI><A href="http://www.aspsky.net/article/list.asp?id=1536"
target=_top
title=無組件文件上傳代碼實例(支持多文件上傳及文件和input域混合上傳)>無組件文件上傳代碼實例(支持多文件上...</A>[<FONT
color=red>6029</FONT>]<BR>
<LI><A href="http://www.aspsky.net/article/list.asp?id=2557"
target=_top title=樹型結構在ASP中的簡單解決>樹型結構在ASP中的簡單解決</A>[<FONT
color=red>5757</FONT>]<BR>
<LI><A href="http://www.aspsky.net/article/list.asp?id=1545"
target=_top title=PHP4實際應用經驗篇(6)>PHP4實際應用經驗篇(6)</A>[<FONT
color=red>5599</FONT>]<BR>
<LI><A href="http://www.aspsky.net/article/list.asp?id=2563"
target=_top title=一個老個寫的無組件上傳>一個老個寫的無組件上傳</A>[<FONT
color=red>5014</FONT>]<BR>
<LI><A href="http://www.aspsky.net/article/list.asp?id=1542"
target=_top title=PHP4實際應用經驗篇(3)>PHP4實際應用經驗篇(3)</A>[<FONT
color=red>4731</FONT>]<BR></LI></TD>
<TD class=p4 vAlign=top width="50%">
<LI><A
href="http://www.aspsky.net/article/list.asp?id=2781">披著羊皮的大野狼 -
Session</A><BR>
<LI><A
href="http://www.aspsky.net/article/list.asp?id=2497">使用sqlserver來存放和取得session</A><BR>
<LI><A
href="http://www.aspsky.net/article/list.asp?id=2370">ASP中使用Session變量的優缺點</A><BR>
<LI><A
href="http://www.aspsky.net/article/list.asp?id=1953">session變量中的數組如何引用</A><BR>
<LI><A
href="http://www.aspsky.net/article/list.asp?id=1939">如何取得所有的Session變量</A><BR>
<LI><A
href="http://www.aspsky.net/article/list.asp?id=1798">關于釋放session的兩篇文章(二)</A><BR>
<LI><A
href="http://www.aspsky.net/article/list.asp?id=1797">關于釋放session的兩篇文章(一)</A><BR></LI></TD></TR>
<TR>
<TD colSpan=2 height=7></TD></TR></TBODY></TABLE>
<TD bgColor=#297dff width=1> </TD></TR></TBODY></TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=755>
<TBODY>
<TR>
<TD bgColor=#297dff height=1><SPACER type="block"
width="1"></TD></TR></TBODY></TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=755>
<TBODY>
<TR>
<TD align=middle height=30></TD></TR></TBODY></TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=755>
<TBODY>
<TR>
<TD align=middle class=p2 width="100%">
<TABLE border=0 cellPadding=0 cellSpacing=0 width=755>
<TBODY>
<TR>
<TD align=middle class=p2 width="100%">
<P align=center><A
href="http://www.aspsky.net/produce/index.asp">客戶服務</A> -- <A
href="http://www.aspsky.net/aspads.asp">廣告合作</A> -- <A
href="http://www.aspsky.net/about.asp">關于本站</A> -- <A
href="http://www.aspsky.net/tell.asp">聯系方法</A><BR><BR>動網先鋒版權所有 <FONT
face=Verdana, size=1 Arial, Helvetica, sans-serif>Copyright ©
2000-2001 <B>AspSky<FONT color=#cc0000>.Net</FONT></B>, All Rights
Reserved .</FONT>
</P></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></CENTER></CENTER></BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -