Reprint: ASP Boutique House Qianfeng
from:http://asp.superexpert.com/code/code.asp?cid=88
Tha Ad Rotator Component enables you to show banner advertisements with different frequencies. This
Component has one method, GetAdvertisement (), which displays a banner advertisement on a page.
Before can use the Ad Rotator component, you need to create two special the Files:the rotator
File and the redirection file. The Rotator Schedule File lists information about all the banner
Advertisements that should to be shown. The redirection File is used to record how-frequently each
Advertisement is clicked.
The three files below demonstrate the Ad rotator Component. Click View Demo to a "live"
Demonstration of this component.
Listing 1.0-adrot.asp
-------------------------------
<body>
<%
Set Myad = Server.CreateObject ("MSWC. AdRotator ")
%>
<center><%=myad.getadvertisement ("Adrot.txt")%></center>
<p>
Click on the image above to visit our sponsor.
</body>
---------------------------------------
Listing 2.0-adrot.txt
---------------------------------------
Redirect/adredir.asp
WIDTH 468
HEIGHT 60
BORDER 1
*
Kidsorg.gif
Http://www.kidsOrg.com
kidsorg
60
Volunteer.gif
Http://www.volunteer.com
Volunteer
40
------------------------------------------
Listing 3.0-adredir.asp
------------------------------------------
<body>
Normally, you would use this file to redirect a user
To The Advertiser ' s home page. You can retrieve info
About which ad the user clicked by examining the following
Query string variables:
<p><b>URL:</b> <%=request ("URL")%>
<p><b>IMAGE:</b> <%=request ("IMAGE")%>
</body>