欢迎光临
我们一直在努力

在ASP中使用Ad Rotator广告组件

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

there are three parts to consider when using the ad rotator component.

the rotator schedule file

the instantiation of the adrotator object itself within the web page where you want your banners rotated

the redirection file

first – the rotator schedule file

this is the meat of the different banners and where they are sent when the graphic files are clicked.

there are two sections –

the first section lists the parameters that apply to all advertisement images in the rotation schedule,

line by line.

the first line is the name of the redirection file.

the second line is the width of the graphic

the third line is the height of the graphics

the fourth line is the border around the graphics – for a one pixel border, you would put 1, for no

border, put in 0

example:

redirect redirect.asp

width 468

height 60

border 0

the second section must be separated from the first section, on a separate line, by an asterisk (*). this

section contains all the data for each of the graphics. for each banner/ad graphics, there are four lines.

first line – the url of the graphic itself (http://www.whatever.com/grphics/myfirstbanner.gif)

second line – the url to where the viewer is redirected when he/she clicks on the banner. this can be a

dash (-) if there is no page to go to (though i couldnt wonder why youd do this, imho)

third line – the mouseover text that will appear

fourth line – the weight of the graphic banner in respect to the others. according to microsoft –

"for example, if a rotator schedule file contains three ads with impressions set to 2, 3, and 5, the first

advertisement is displayed 20 percent of the time, the second 30 percent of the time, and the third 50

percent of the time."

once this page is finished, you must save it and name it. for this example, i have named mine adrot.txt.

it doesnt have to be an asp or html file….no headers are involved, just the plain text.

——————————————————————————–

second – instantiate the object in the asp page:

<% dim myad

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

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

you can put html centers around this section of code to center it on the page.

——————————————————————————–

now, theres one last part – the redirection file. above, you will notice that, in this example, i called

it redirect.asp. you can call it anything you want – it doesnt matter what its called.

on that page all you need is the following code:

<% response.redirect(request.querystring("url")) %>

just remember, if you have created a new page with a program that includes all the html basic markup and

you put this line in the file, you must put the following line as the first line of the file so it will

work:

<% response.buffer= true%>

and thats it – thats all it takes to get the ad rotator component working.

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