|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
缺乏可以共同遵循的行业标准,ASP还处在发展初期,大家对它的理解不同,如产品和服务标准,收费标准等,不利于行业的健康发展。告白TherearethreepartstoconsiderwhenusingtheAdRotatorcomponent.
TheRotatorScheduleFile
TheinstantiationoftheAdRotatorobjectitselfwithinthewebpagewhereyouwantyourbannersrotated
TheRedirectionFile
First-TheRotatorScheduleFile
Thisisthemeatofthedifferentbannersandwheretheyaresentwhenthegraphicfilesareclicked.
Therearetwosections-
Thefirstsectionliststheparametersthatapplytoalladvertisementimagesintherotationschedule,
linebyline.
ThefirstlineisthenameoftheRedirectionFile.
Thesecondlineisthewidthofthegraphic
Thethirdlineistheheightofthegraphics
ThefourthLineistheborderaroundthegraphics-foraonepixelborder,youwouldput1,forno
border,putin0
Example:
redirectRedirect.asp
Width468
Height60
Border0
Thesecondsectionmustbeseparatedfromthefirstsection,onaseparateline,byanasterisk(*).This
sectioncontainsallthedataforeachofthegraphics.Foreachbanner/adgraphics,therearefourlines.
FirstLine-theurlofthegraphicitself(http://www.whatever.com/grphics/MyFirstBanner.gif)
SecondLine-theURLtowheretheviewerisredirectedwhenhe/sheclicksonthebanner.Thiscanbea
dash(-)ifthereisnopagetogoto(thoughIcouldntwonderwhyyouddothis,IMHO)
Thirdline-themou搜索引擎优化vertextthatwillappear
Fourthline-theweightofthegraphicbannerinrespecttotheothers.AccordingtoMicrosoft-
"Forexample,ifaRotatorSchedulefilecontainsthreeadswithimpressionssetto2,3,and5,thefirst
advertisementisdisplayed20percentofthetime,thesecond30percentofthetime,andthethird50
percentofthetime."
Oncethispageisfinished,youmustsaveitandnameit.Forthisexample,Ihavenamedmineadrot.txt.
ItdoesnthavetobeanASPorHTMLfile....noheadersareinvolved,justtheplaintext.
--------------------------------------------------------------------------------
Second-InstantiatetheobjectintheASPpage:
<%DimMyAd
SetMyAd=Server.CreateObject("MSWC.AdRotator")%>
<%=MyAd.GetAdvertisement("/adrot.txt")%>
YoucanputHTMLCentersaroundthissectionofcodetocenteritonthepage.
--------------------------------------------------------------------------------
Now,theresonelastpart-theRedirectionfile.Above,youwillnoticethat,inthisexample,Icalled
itRedirect.asp.Youcancallitanythingyouwant-itdoesntmatterwhatitscalled.
Onthatpageallyouneedisthefollowingcode:
<%Response.Redirect(Request.QueryString("url"))%>
Justremember,ifyouhavecreatedanewpagewithaprogramthatincludesalltheHTMLbasicmarkupand
youputthislineinthefile,youmustputthefollowinglineasthefirstlineofthefilesoitwill
work:
<%Response.Buffer=true%>
Andthatsit-thatsallittakestogettheAdRotatorComponentworking.
</p>ASP在国内异常流行,因为国内大多使用的是盗版的Windows和盗版的SQLServer,而ASP+COM+SQLServer实际上也是一种不错的搭配,其性能也不输于PHP+MYSQL,特别是Windows系统和SQLServer都有图形界面,比APACHE和MYSQL易于维护,因此对于不重视知识产权的国家来说也是一种不错的选择。 |
|