OK, let's look at the ASP AdRotator component Instance Tutorial.
The ASP AdRotator component creates a AdRotator object that displays a different picture each time the user enters or collates the page. A text file contains related pictures.
Grammar
<%
Set Adrotator=server.createobject ("MSWC. AdRotator ")
AdRotator. GetAdvertisement ("Textfile.txt")
%>
For example
Suppose we have a file named "Banners.asp". It looks like this:
<body>
<%
Set Adrotator=server.createobject ("MSWC. AdRotator ")
Response.Write (AdRotator. GetAdvertisement ("Ads.txt"))
%>
</body>
The file "Ads.txt" looks like this:
*
W3schools.gif
http://www.111cn.net/
Visit W3Schools
80
Microsoft.gif
http://www.111cn.net/
Visit Microsoft
20
The line below the asterisk file "Ads.txt" Specifies the image shown, hyperlink address, alternative text (for images), and displays at the rate of the hit. We see that the http://www.111cn.net/image will display 80 hits and the Microsoft image will be displayed as 20 of the hits on the text file.
Note: To get a contact job when the user clicks on them, we will have to modify the file "Ads.txt" somewhat:
REDIRECT banners.asp
*
W3schools.gif
http://www.w3schools.com/
Visit W3Schools
80
Microsoft.gif
http://www.microsoft.com/
Visit Microsoft
20
The redirect page (banners.asp) now receives a query string variable named after the URL that contains the URL redirect to.
Note: To specify the height, width, and image of the border, you can insert the following line redirection:
REDIRECT banners.asp
WIDTH 468
HEIGHT 60
BORDER 0
*
111cn.gif
...
...
The thing in the past is to add some code lines to the "banners.asp" file:
<%
url=request.querystring ("url")
If url<> "" then Response.Redirect (URL)
%>
<body>
<%
Set Adrotator=server.createobject ("MSWC. AdRotator ")
Response.Write (AdRotator. GetAdvertisement ("Textfile.txt"))
%>
</body>
Okay, let's look at the ASP AdRotator methods and properties.
For example, property description
Border designated size, the border around the advertisement "%
Set Adrot = Server.CreateObject ("MSWC.") AdRotator ")
Adrot. Border = "2"
Response.Write (Adrot. GetAdvertisement ("Ads.txt"))
% “
Click on whether the specified advertisement is a hyperlink "%
Set Adrot = Server.CreateObject ("MSWC.") AdRotator ")
Adrot. clickable = False
Response.Write (Adrot. GetAdvertisement ("Ads.txt"))
% “
TargetFrame Name box to display AD "%
Set Adrot = Server.CreateObject ("MSWC.") AdRotator ")
Adrot. TargetFrame = "target = ' _blank '"
Response.Write (Adrot. GetAdvertisement ("Ads.txt"))
% “
Method
such as Description method
GetAdvertisement return HTML Display ads on page <%
Set Adrot = Server.CreateObject ("MSWC.") AdRotator ")
Response.Write (Adrot. GetAdvertisement ("Ads.txt"))
% “