01.
<%@ Page Language=
"VB"
%>
02.
<script runat=
"server"
>
03.
04.
Sub
Page_Load(sender
As
Object
, e
As
EventArgs)
05.
Application(
"Database"
) =
"mydatabase.mdb"
06.
Application(
"UserID"
) =
"myuser"
07.
Application(
"Password"
) =
"mypassword"
08.
09.
Application.RemoveAll()
10.
11.
If
Application.Count = 0
Then
12.
Me
.lblText.Text =
"Application is nothing"
13.
Else
14.
ViewApplication()
15.
End
If
16.
End
Sub
17.
18.
Sub
ViewApplication()
19.
Dim
items
As
Object
20.
For
Each
items
In
Application.Keys
21.
Me
.lblText.Text =
Me
.lblText.Text & items &
" = "
& Application(items) &
"<br>"
22.
Next
23.
End
Sub
24.
25.
</script>
26.
<html>
27.
<head>
28.
<title>ThaiCreate.Com ASP.NET - Application
Object
</title>
29.
</head>
30.
<body>
31.
<form id=
"form1"
runat=
"server"
>
32.
<asp:Label id=
"lblText"
runat=
"server"
></asp:Label>
33.
</form>
34.
</body>
35.
</html>