![ASP横幅广告系统外文翻译_第1页](http://file2.renrendoc.com/fileroot_temp3/2021-8/9/9cbf4a08-fa69-4c7d-b09f-048b9dd4f65d/9cbf4a08-fa69-4c7d-b09f-048b9dd4f65d1.gif)
![ASP横幅广告系统外文翻译_第2页](http://file2.renrendoc.com/fileroot_temp3/2021-8/9/9cbf4a08-fa69-4c7d-b09f-048b9dd4f65d/9cbf4a08-fa69-4c7d-b09f-048b9dd4f65d2.gif)
![ASP横幅广告系统外文翻译_第3页](http://file2.renrendoc.com/fileroot_temp3/2021-8/9/9cbf4a08-fa69-4c7d-b09f-048b9dd4f65d/9cbf4a08-fa69-4c7d-b09f-048b9dd4f65d3.gif)
![ASP横幅广告系统外文翻译_第4页](http://file2.renrendoc.com/fileroot_temp3/2021-8/9/9cbf4a08-fa69-4c7d-b09f-048b9dd4f65d/9cbf4a08-fa69-4c7d-b09f-048b9dd4f65d4.gif)
![ASP横幅广告系统外文翻译_第5页](http://file2.renrendoc.com/fileroot_temp3/2021-8/9/9cbf4a08-fa69-4c7d-b09f-048b9dd4f65d/9cbf4a08-fa69-4c7d-b09f-048b9dd4f65d5.gif)
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、asp banner ad systemto the reader from joe:this is a user-submitted tutorial by the author above. i have read the tutorial and set the format to fit html goodies, but for the most part have not changed the language. i chose this tutorial because many readers have been asking for more asp tutorials.
2、this is a great one.sorry i cannot show you the event here. the html goodies servers do not offer asp. i will tell you though that if you run ie5.0 or better, open the contents of the zip file into a directory and it runs just fine.if you havent already, you may want to read my introductoryasp tutor
3、ialbefore this one. if not, then enjoy. there may be a point in your web design career, where your site becomes real popular. that is when companies become interested in advertising on your site. a banner ad system can be built to control all those advertisements that you are so willing to display,
4、for a price. active server pages makes it very easy to create a banner ad system. so easy, that the microsoft asp developers created an adrotator component for the occasion. before you begin reading this article, make sure you download the support material below.the files included aread.txtbanner.as
5、p3 banner imagesclicks.aspexample.aspredirect.aspad.txtin order for the adrotator component to work, you must configure a text file. this text file contains all the banner ad properties. however, the text file must follow a certain format. the first four lines are as follows:redirect redirect.aspwid
6、th 400height 50*redirectwhen a banner is clicked, the adrotator component goes to a preliminary page. this page is called a redirect page. the redirect page handles any extra programming events before directing a user to the banners destination. in this example banner system, i called the preliminar
7、y file redirect.asp.widththis sets the width of the banner ad image. the value must be in pixels.heightthis sets the height of the banner ad image. the value must be in pixels.*the asterisk tells the adrotator component that it is about to acquire banner ad information. the asterisk is required.once
8、 you define the general properties above the asterisk, then comes the list of banners to display. in thead.txtfile, there are three banners defined below the asterisk.banner1.jpghtmlg20banner2.jpgy30banner3.jpgd30each banner requires four lines of properties, which follow the format below:image file
9、nameweb address descriptionbanner weightimage filethe image filename can be a fully qualified web address or relative name that points to the image. if the image is in a different folder, then you also include the folder name as well.( banner1.jpg, or foldername/banner.jpg)web addressthe web address
10、 can be a page on your site or a fully qualified web address that leads to another site.descriptionthe description will be displayed as a tool tip. when you rest your mouse over the banner, the description pops up.banner weightthe banner weight determines how much a banner is displayed. the adrotato
11、r component adds all of the banner weights and determines the probability or percent chance of a particular banner being displayed. a banner with a higher weight has better a better probability.note:you can disable a banners property by substituting with a dash.banner3.jpg-d30the example entry above
12、 would create a banner ad that does not have a web address.banner.aspthis file uses the adrotator component and analyzes the contents of the ad.txt file. below is the code.sub banner(strtarget)dim bannerad, htmlset bannerad = server.createobject(mswc.adrotator)bannerad.targetframe = strtargethtml =
13、bannerad.getadvertisement(ad.txt)response.write htmlend subthe first thing to note is that the asp was written with vbscript. the second thing to note is that the code is written inside a sub procedure calledbanner(strtarget).for those of you who do not know, a sub procedure allows you to group toge
14、ther a bunch of code that can be reused over and over. like a function, it takes an argument, such as a word or variable. in the code above the argument is strtarget.unlike a function, a sub-procedure does not return any values, it just executes the code inside line by line.inside the sub i declare
15、two variables.dim bannerad, htmlnext i store the adrotator component inside the bannerad variable. when storing a component inside a variable you use the set keyword. since we are programming server-side with asp, we use server.createobject to summon the component. mswc.adrotator is the component ke
16、y or name value.set bannerad = server.createobject(mswc.adrotator)next i use a property of the adrotator called targetframe. this property is equivalent to:the target-value can be one of the values below:_blankopens the destination link in a new browser window._topopens the destination link on top o
17、f the web page._parentopens the destination link within a parent frame._newopens the destination link in a new browser window.next, i use an adrotator method or function called getadvertisement and stored its results in the html variable. notice that the getadvertisement takes the name of the ad ban
18、ner text file as an argument.html = bannerad.getadvertisement(ad.txt)finally, i want to print the contents of the html variable. this prints the code that displays the banner images.response.write htmlredirect.aspthis is the file that is processed before someone is redirected to the banners web addr
19、ess. inside this file, we can capture information like how many times a particular banner is clicked and so on. to start things off, i defined a variable called strurl.dim strurlnext i store a querystring value inside this new variable.strurl = request.querystring(url)a querystring is nothing more t
20、han a bunch of name/value pairs attached to a web address. when a user clicks on a banner, the adrotator component attaches a querystring to the redirect file. so if we were to click banner1.jpg, defined in ad.txt, we would end up with a redirect web address that looks like so.redirect.asp?url=&imag
21、e=banner1.jpgin essence assigning request.querystring(url) to strurl, is the same as assigning to it.finally, i check to see which banner was clicked. i accomplish this with the vbscript instr( ) function.if instr(strurl, htmlgoodies) then application.lockapplication(htmlgoodies) = application(htmlg
22、oodies) + 1application.unlockresponse.clearresponse.redirect strurlend ifthe instr( ) function returns the number position of a sub-word (sub-string) within another word (string). the format is as followsinstr(main word, sub-word)if the sub-word exist within the main word, then the function will equ
23、al a number greater-than zero or true. if the sub-word does not exist, then the function will equal zero or false. in the example above, i check to see if htmlgoodies exist within . since the answer is true, then the code inside the if. then. statement will execute.inside the if. then. i use an appl
24、ication variable. an application variable is native to asp. application variables store information as long as a web application exist, a web application ceases to exist when say someone shuts off the web hosting server. the beauty of an application variable is that you can define it on one web page
25、 and use it in other web pages within your web application. the downfall is that the users computer must have cookies enabled.anyways, the code adds one to the application variable, every time a banner is clicked. after one is added, the code redirects to the banners web page. so if banner1 was clic
26、ked then you shall be redirected to .response.redirect strurlexample.aspthis is an example page that uses the banner ad system. when you refresh the page, you should most likely see a different banner. whenever you want to insert the banner ad on a page, you can use the ssi directive below.once you
27、include the file above, then you can call the sub-procedure inside the banner.asp file like so.call banner(_blank)notice that i supply one of the values for the targetframe as an argument. so if the banner is clicked, then the web page should open up in a separate browser window.clicks.aspthis is a
28、very simple page that displays the number of clicks per banner ad. to display the number of times a banner was clicked, you just print the contents of the application variables that were created inside redirect.asp. pretty nifty.asp横幅广告系统乔给读者的话:这是一个由用户提交上述笔者的教程。我已经阅读教程和设置格式,以适应的html超值,但大部分都没有改变的语言。我
29、选择了这个教程,因为很多读者已经要求更多的asp教程。这是一个伟大的。对不起,我不能告诉你这里的事件。服务器的html超值不提供的asp。我会告诉你,不过,如果你运行的ie5.0或更高,打开zip文件的内容到一个目录,它运行得很好。如果你还没有,你可能会想读这之前我介绍的asp教程。如果没有,那么享受。可能会出现在你的网页设计生涯中,在您的网站变成真正的流行点。这是当企业成为您的网站上刊登广告感兴趣。可以建立一个横幅广告系统,控制所有你所以愿意以优惠的价格,以显示这些广告。active server pages的,使得它很容易地创建一个横幅广告系统。那么容易,微软的asp开发人员创建了一个组件
30、之际的“adrotator”。在你开始阅读本文之前,确保你下载下面的支撑材料。这些文件包括ad.txtbanner.asp3 banner imagesclicks.aspexample.aspredirect.aspad.txt为了adrotator组件来工作,你必须配置一个文本文件。这个文本文件包含了所有的横幅广告属性。然而,文本文件必须遵循一定的格式。前四行如下.redirect redirect.aspwidth 400height 50*重定向当点击旗帜“的adrotator”组件去一个初步的页面。此页被称为重定向页面。重定向页面处理指导用户横幅目的地之前,任何额外的编程事件。在这个
31、例子中的旗帜,我称为“redirect.asp”初步文件。宽度此设置的横幅广告图片的宽度。该值必须以像素为单位。高度这设置的横幅广告形象的高度。该值必须以像素为单位。*星号告诉的“adrotator”的组成部分,这是有关收购横幅广告信息。星号是必需的。一旦你定义了星号以上的一般性质,然后是列表显示的横幅。在ad.txt文件,有星号下面定义了三个横幅。banner1.jpghtmlg20banner2.jpgy30banner3.jpgd30每个旗帜需要四行属性,按照下面的格式.图像的文件名网址描述旗帜重量影像档图像的文件名可以是一个完全合格的网络地址或相对指向图像的名称。如果图像是在不同的文件
32、夹,那么你还包括文件夹的名称。(网址网络地址可以是您的网站或完全限定的网络地址,导致另一个网站的页面。描述说明将显示为工具提示。当你休息的旗帜,你的鼠标,弹出的描述。旗帜重量多少显示的一面旗帜,旗帜重量决定。“的adrotator”组件添加了所有的旗帜权和决定的可能性或正在显示一个特定的横幅的机会。具有较高的权重的旗帜,具有较好的一个更好的概率。注意:您可以禁用代以破折号1横幅财产。banner3.jpg-d30上面的条目示例将创建一个横幅广告,没有一个网址。banner.asp此文件使用“的adrotator”组件和分析的ad.txt文件内容。下面是代码。sub banner(strtarg
33、et)dim bannerad, htmlset bannerad = server.createobject(mswc.adrotator)bannerad.targetframe = strtargethtml = bannerad.getadvertisement(ad.txt)response.write htmlend sub首先要注意的是用vbscript编写的asp。第二件事要注意的是,代码内编写一个子过程称为横幅(strtarget)。对于那些你谁也不知道,子过程允许你组合到一起一堆代码可以一遍又一遍地重复使用。就像一个函数,它需要一个参数,如一个字或变量。在上述参数的代码是s
34、trtarget。不像一个函数,子过程不返回任何值,它只是按行内执行的代码。内子,我声明两个变量.dim bannerad, html接下来,我将内部的“bannerad”变量“adrotator的”组成部分。存储组件内部变量当您使用设定的关键字。因为我们是用asp编程服务器端,我们使用server.createobject,召唤组件。的“mswc.adrotator”组件键或名称值。set bannerad = server.createobject(mswc.adrotator)接下来,我使用“的adrotator”称为“targetframe”的属性。此属性相当于.目标的值可以是下列值之
35、一._blankopens the destination link in a new browser window._topopens the destination link on top of the web page._parentopens the destination link within a parent frame._newopens the destination link in a new browser window.接下来,我使用“的adrotator”的方法或函数称为“getadvertisement”,其结果存储在变量的“html”。请注意,“getadvertisement”广告横幅文本文件作为一个参数的名称。html = bannerad.getadvertisement(ad.txt)最后,我想打印的“html”变量的内容。打印显示的横幅图片的代码。回复于htmlredirect.asp这是被处理的文件之前,有人被重定向到的横幅网页地址。在这个文件中,我们可以抓住这样一个特定的旗帜多少次被点击等信息。要开始做事了,我定义了一个名为“strurl的变量。dim str
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 《齿轮传动实验》课件
- 西尔斯当代大学物理双语课件
- 笔算乘法练习课课件
- 《LED显示屏介绍》课件2
- 大单元理念下的分数教学实践与思考
- 《纺织污染》课件
- 《非营利组织营销》课件
- 2024-2025学年高中语文 第三单元 第12课 鱼书说课稿 粤教版必修2
- 幼儿故事改编动画片观后感
- 童年时光里的友情故事
- 口腔接诊流程
- 东风汽车网上测评答案
- 妇科常见急危重症护理
- 企业员工信息安全意识培训
- 2025-2030年中国智能安防行业发展状况及前景规划研究报告
- 2024年广告部业务年度工作计划样本(3篇)
- 《大学生创新创业实务》课件-2.1创新思维训练 训练创新思维
- 2025届高考化学 二轮复习 专题五 离子共存(含解析)
- 能源管理软件招标模板高效节能
- 2024年临床医师定期考核必考复习题库及答案(150题)
- 城乡环卫保洁投标方案
评论
0/150
提交评论