欢迎光临
我们一直在努力

Ad Rotator组件使用例子

建站超值云服务器,限时71元/月

转载: asp精品屋 钱丰云

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 you can use the ad rotator component, you need to create two special files: the rotator schedule

file and the redirection file. the rotator schedule file lists information about all the banner

advertisements that should be shown. the redirection file is used to record how frequently each

advertisement is clicked.

the three files below demonstrate how to use the ad rotator component. click view demo to see a "live"

demonstration of this component.

listing 1.0 – adrot.asp

——————————-

<html>

<head><title>adrot.asp</title></head>

<body>

<%

set myad = server.createobject( "mswc.adrotator" )

%>

<center><%=myad.getadvertisement( "adrot.txt" )%></center>

<p>

click on the image above to visit our sponsor.

</body>

</html>

—————————————

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

——————————————

<html>

<head><title>adredir.asp</title></head>

<body>

<h3>this is the adredir.asp file</h3>

normally, you would use this file to redirect a user

to the advertisers 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>

</html>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » Ad Rotator组件使用例子
分享到: 更多 (0)