ASP အကြောင်းအရာ များစုစည်းမှု
❮ အပလီကေးရှင်းအရာဝတ္တုအကိုးအကားကို အပြီးသတ်ပါ။
အကြောင်းအရာများ စုစည်းမှုတွင် script command မှတဆင့် အပလီကေးရှင်း/စက်ရှင်တွင် ထည့်သွင်းထားသော အရာများအားလုံး ပါဝင်သည်။
အကြံပြုချက်- အကြောင်းအရာများ စုစည်းမှုမှ အရာများကို ဖယ်ရှားရန်၊ ဖယ်ရှားရန်နှင့် အားလုံးကို ဖယ်ရှားရန် နည်းလမ်းများကို အသုံးပြုပါ။
အထားအသို
Application.Contents(Key)
Session.Contents(Key)
Parameter | Description |
---|---|
key | Required. The name of the item to retrieve |
Application Object အတွက် နမူနာများ
ဥပမာ ၁
အကြောင်းအရာစုစည်းမှုတွင် အမည်နှင့် objtest နှစ်ခုစလုံးကို ထပ်ထည့်မည်ဖြစ်ကြောင်း သတိပြုပါ။
<%
Application("name")="W3Schools"
Set Application("objtest")=Server.CreateObject("ADODB.Connection")
%>
ဥပမာ ၂
အကြောင်းအရာ စုစည်းမှုအား လှည့်ပတ်ရန်-
<%
for each x in Application.Contents
Response.Write(x & "=" & Application.Contents(x) & "<br>")
next
%>
or:
<%
For i=1 to Application.Contents.Count
Response.Write(i & "=" & Application.Contents(i) & "<br>")
Next
%>
ဥပမာ ၃
<%
Application("date")="2001/05/05"
Application("author")="W3Schools"
for each x in Application.Contents
Response.Write(x & "=" & Application.Contents(x) & "<br>")
next
%>
Output:
date=2001/05/05
author=W3Schools
Session Object အတွက် ဥပမာများ
ဥပမာ ၁
အကြောင်းအရာစုစည်းမှုတွင် အမည်နှင့် objtest နှစ်ခုစလုံးကို ထပ်ထည့်မည်ဖြစ်ကြောင်း သတိပြုပါ။
<%
Session("name")="Hege"
Set Session("objtest")=Server.CreateObject("ADODB.Connection")
%>
ဥပမာ ၂
အကြောင်းအရာ စုစည်းမှုအား လှည့်ပတ်ရန်-
<%
for each x in Session.Contents
Response.Write(x & "=" & Session.Contents(x) & "<br>")
next
%>
or:
<%
For i=1 to Session.Contents.Count
Response.Write(i & "=" & Session.Contents(i) & "<br>")
Next
%>
ဥပမာ ၃
<%
Session("name")="Hege"
Session("date")="2001/05/05"
for each x in Session.Contents
Response.Write(x & "=" & Session.Contents(x) & "<br>")
next
%>
Output:
name=Hege
date=2001/05/05
❮ အပလီကေးရှင်းအရာဝတ္တုအကိုးအကားကို အပြီးသတ်ပါ။