ບັນດາວັດຖຸ Application ASP
- ຫນ້ານັ້ນຫນ້ານັ້ນ ຄູ່ມື Session ASP
- ຫນ້ານັ້ນ ASP #include
ກຸ່ມສະໜາມ ASP ທີ່ຈະຮ່ວມກັນເພື່ອຈະຮັບການຄວາມສຳຄັນຊຶ່ງຫມາຍຄວາມວ່າອົງການ application. Application Object ໃນ ASP ມີການປະສົມບັນຊີທັງໝົດ.
Application Object
ອົງການຂອງຄອມພິວເຕີ້ເວັບສານທີ່ສາມາດເປັນກຸ່ມສະໜາມ ASP. ສະໜາມສະໜາມ ASP ຈະມີວຽກງານຮ່ວມກັນເພື່ອຈະຮັບການຄວາມສຳຄັນ. Application Object ໃນ ASP ມີການປະສົມບັນຊີທັງໝົດ.
ອົງການ Application ມີການຮັກສາແລະເຂົ້າເຖິງຂໍ້ມູນຈາກເວັບໄຊໃດໆທີ່ຫມາຍຄວາມວ່າອົງການ session. ຄວາມແຕກຕ່າງກ່າວວ່າທຸກຄົນໃຊ້ເປັນອົງການ Application ໜຶ່ງຫມາຍຄວາມວ່າອົງການ session ແມ່ນກັບຄົນໃຊ້ແບບສະເພາະ.
ອົງການ Application ມີຂໍ້ມູນທີ່ຈະຖືກໃຊ້ໂດຍເວັບໄຊຫຼາຍໆ (ອີງຕາມຂໍ້ມູນການເຊື່ອມຕໍ່ຖານຂໍ້ມູນ)。ນີ້ຫມາຍຄວາມວ່າຂໍ້ມູນດັ່ງກ່າວຈະສາມາດເຂົ້າເຖິງຈາກເວັບໄຊໃດໆ. ນີ້ຍັງຫມາຍຄວາມວ່າທ່ານສາມາດປ່ຽນແປງຂໍ້ມູນໃນບ່ອນໜຶ່ງແລະການປ່ຽນແປງຈະສະຖິຕິກັບເວັບໄຊທັງໝົດ.
Store and retrieve Application variables
Application variables can be accessed and modified by any page in the application.
Can create Application variables like this in "Global.asa":
<script language="vbscript" runat="server"> Sub Application_OnStart application("vartime")="" application("users")=1 End Sub </script>
In the above example, we created two Application variables: "vartime" and "users".
Can access the value of Application variables like this:
<% Response.Write(Application("users")) %>
Traverse Contents collection
Contents collection contains all application variables. We can traverse the contents collection to view the variables stored within:
<% dim i For Each i in Application.Contents Response.Write(i & "<br />") Next %>
ຖ້າເຈົ້າບໍ່ຮູ້ຈັງຈາກຈຳນວນຂອງຫົວຂໍ້ contents, ສາມາດໃຊ້ຜົນງານ count ເພື່ອ:
<% dim i dim j j=Application.Contents.Count For i=1 to j Response.Write(Application.Contents(i) & "<br />") Next %>
Traverse StaticObjects collection
ສາມາດໃຊ້ການຫຼິ້ນວົງ StaticObjects ເພື່ອເບິ່ງຄຸນຂອງວັດຖຸທີ່ບັນຈຸໃນລະບົບ Application:
<% dim i For Each i in Application.StaticObjects Response.Write(i & "<br />") Next %>
Locking and Unlocking
ພວກເຮົາສາມາດໃຊ້ວິທີ "Lock" ເພື່ອກັກກັນຄອມພິວເຕີ້ລະບົບຫຼັງຈາກນັ້ນບໍ່ສາມາດປ່ຽນປ່ຽນທີ່ຢູ່ໃນລະບົບ Application (ບໍ່ແມ່ນຜູ້ທີ່ກຳລັງເຂົ້າເຖິງລະບົບ Application). ພວກເຮົາກໍ່ສາມາດໃຊ້ວິທີ "Unlock" ເພື່ອປົດກັນກັບຄອມພິວເຕີ້ລະບົບ. ວິທີນີ້ຈະປົດກັນກັບການກັກກັນຂອງລະບົບ Application:
<% Application.Lock 'ເຮັດບາງການປະຕິບັດວັດຖຸການນຳໃຊ້' Application.Unlock %>
- ຫນ້ານັ້ນຫນ້ານັ້ນ ຄູ່ມື Session ASP
- ຫນ້ານັ້ນ ASP #include