<%@ Page Language="VB" %> <script runat="server"> Sub Page_Load(sender As Object, e As EventArgs) Application("Database") = "mydatabase.mdb" Application("UserID") = "myuser" Application("Password") = "mypassword" ViewApplication() End Sub Sub ViewApplication() Me.lblText1.Text = "Database = " & Application("Database") Me.lblText2.Text = "UserID = " & Application("UserID") Me.lblText3.Text = "Password = " & Application("Password") End Sub </script> <html> <head> <title>ThaiCreate.Com ASP.NET - Application Object</title> </head> <body> <form id="form1" runat="server"> <asp:Label id="lblText1" runat="server"></asp:Label><br /> <asp:Label id="lblText2" runat="server"></asp:Label><br /> <asp:Label id="lblText3" runat="server"></asp:Label><br /> </form> </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท