帝国软件
  设为首页 加入收藏 关于我们
 
解密帝国网站管理系统
栏 目:
 
您的位置:首页 > 技术文档 > ASP编程
在ASP中使用Ad Rotator广告组件
作者: 发布时间:2005-03-12 来源:
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 couldn't wonder why you'd 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 doesn't 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, there's 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 doesn't matter what it's 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 that's it - that's all it takes to get the Ad Rotator Component working.
  
评论】【加入收藏夹】【 】【打印】【关闭
※ 相关链接
 ·在ASP中判断SQL语句是否执行成功  (2005-03-12)
 ·如何在ASP中通过ODBC调用Excel中  (2005-03-12)
 ·谈谈对于ASP+ PDC bits的经验  (2005-03-12)
 ·在ASP+中使用Cookie  (2005-03-12)
 ·在ASP中使用类  (2005-03-12)
 ·在ASP中使用Java类(Using Java C  (2005-03-12)
 ·在ASP中改善动态分页的性能  (2005-03-12)
 ·在asp中调用jsp  (2005-03-12)
 ·较长text型数据无法在Asp页面中取  (2005-03-12)
 ·在ASP中用“正则表达式对象”来校  (2005-03-12)

   栏目导行
  PHP编程
  ASP编程
  ASP.NET编程
  JAVA编程
   站点最新
·致合作伙伴的欢迎信
·媒体报道
·帝国软件合作伙伴计划协议
·DiscuzX2.5会员整合通行证发布
·帝国CMS 7.0版本功能建议收集
·帝国网站管理系统2012年授权购买说
·PHPWind8.7会员整合通行证发布
·[官方插件]帝国CMS-访问统计插件
·[官方插件]帝国CMS-sitemap插件
·[官方插件]帝国CMS内容页评论AJAX分
   类别最新
·在ASP中使用数据库
·使用ASP脚本技术
·通过启动脚本来感受ASP的力量
·学习使用ASP对象和组件
·解析asp的脚本语言
·初看ASP-针对初学者
·ASP开发10条经验总结
·ASP之对象总结
·ASP与数据库应用(给初学者)
·关于学习ASP和编程的28个观点
 
关于帝国 | 广告服务 | 联系我们 | 程序开发 | 网站地图 | 留言板 帝国网站管理系统