取得Application 对象变量的语法如下所示:
变数=Application("变量名称")
接下来我们来实际操作Application 变量。下列范例宣告了三个Application 对象变量,利用循环显示后并清除:
<Html>
<Script Language="VB" Runat="Server">
Sub Page_Load(Sender As Object,e As Eventargs)
Dim shtI As Short
Application.Add("App1","Value1")
Application.Add("App2","Value2")
Application.Add("App3","Value3")
For shtI=0 To Application.Count-1
Response.Write("变量名:" & Application.GetKey(shtI) )
Response.Write(" ,变数值:" & Application.Item(shtI) & "<P>")
Next
Application.Clear()
End Sub
</Script>
</Html>