ASP အကြောင်းအရာ Rotator အစိတ်အပိုင်း (ASP 3.0)
ASP အကြောင်းအရာ Rotator အစိတ်အပိုင်း
ASP Content Rotator အစိတ်အပိုင်းသည် လည်ပတ်သူတစ်ဦး စာမျက်နှာတစ်ခုသို့ ဝင်ရောက်သည့်အခါတိုင်း သို့မဟုတ် ပြန်လည်စတင်သည့်အခါတိုင်း မတူညီသော အကြောင်းအရာစာကြောင်းကို ပြသသည့် ContentRotator အရာဝတ္ထုတစ်ခုကို ဖန်တီးပေးသည်။
Content Schedule File ဟုခေါ်သော စာသားဖိုင်တွင် အကြောင်းအရာ စာကြောင်းများအကြောင်း အချက်အလက် ပါဝင်သည်။
အကြောင်းအရာ strings များတွင် HTML တဂ်များ ပါဝင်နိုင်သောကြောင့် HTML ကိုယ်စားပြုနိုင်သည့် မည်သည့်အကြောင်းအရာအမျိုးအစားကိုမဆို ပြသနိုင်သည်- စာသား၊ ပုံများ၊ အရောင်များ သို့မဟုတ် ဟိုက်ပါလင့်ခ်များ။
အထားအသို
<%
Set cr=Server.CreateObject("MSWC.ContentRotator")
%>
ASP အကြောင်းအရာ Rotator ဥပမာ
အောက်ပါ ဥပမာသည် ဝဘ်စာမျက်နှာကို လာရောက်ကြည့်ရှုသူတိုင်း ကြည့်ရှုတိုင်း မတူညီသော အကြောင်းအရာကို ပြသသည်။
ပထမဦးစွာ "textads.txt" ဟု အမည်ပေးထားသော စာသားဖိုင်ကို ဖန်တီးပြီး ၎င်းကို "စာသား" ဟုခေါ်သော ဖိုင်တွဲခွဲတစ်ခုတွင် ထားရှိပါ။
"textads.txt"-
%% #3
<h2>This is a great day!!</h2>
%% #3
<img src="smiley.gif">
%% #4
<a href="https://www.w3schools.com">Visit W3Schools.com</a>
အကြောင်းအရာစာကြောင်းတစ်ခုစီ၏အစတွင် #နံပါတ်ကို သတိပြုပါ။ ဤနံပါတ်သည် HTML အကြောင်းအရာ string ၏ ဆက်စပ်အလေးချိန်ကို ညွှန်ပြသော ရွေးချယ်နိုင်သော ကန့်သတ်ဘောင်တစ်ခုဖြစ်သည်။ အထက်ဖော်ပြပါ စာသားဖိုင်တွင်၊ Content Rotator သည် အချိန်၏ ပထမနှင့် ဒုတိယအကြောင်းအရာကို အချိန်၏ ဆယ်ပုံတစ်ပုံနှင့် တတိယစာတန်းကို အချိန်၏ ဆယ်ပုံတစ်ပုံအထိ ပြသမည်ဖြစ်သည်။
ထို့နောက် ASP ဖိုင်တစ်ခုဖန်တီးပြီး အောက်ပါကုဒ်ကို ထည့်သွင်းပါ။
ဥပမာ
<html>
<body>
<%
set cr=server.createobject("MSWC.ContentRotator")
response.write(cr.ChooseContent("text/textads.txt"))
%>
</body>
</html>
ASP အကြောင်းအရာ Rotator Component ၏နည်းလမ်းများ
Method | Description | Example |
---|---|---|
ChooseContent | Gets and displays a content string | <% dim cr Set cr=Server.CreateObject("MSWC.ContentRotator") response.write(cr.ChooseContent("text/textads.txt")) %> Output: |
GetAllContent | Retrieves and displays all of the content strings in the text file | <% dim cr Set cr=Server.CreateObject("MSWC.ContentRotator") response.write(cr.GetAllContent("text/textads.txt")) %> Output: This is a great day!! |