|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
ASP脚本是采用明文(plaintext)方式来编写的。显现|语法<!--#includefile="token.asp"-->
<%*************************************************************************
Thisisalltest/examplecodeshowingthecallingsyntaxofthe
cBufferclass...theinterfacetothecBufferobjectisquitesimple.
Useitforreference...deleteit...whatever.
*************************************************************************
REMThisisaremtypecommentjustfortestingpurposes!
ThisvariablewillholdaninstanceofthecBufferclass
DimobjBuffer
Setuptheerrorhandling
OnErrorResumeNext
createtheinstanceofthecBufferclass
SetobjBuffer=NewcBuffer
SetthePathToFilepropertyofthecBufferclass
Justforkickswellusetheaspfilethatwecreated
inthelastinstallmentofthisarticleseriesfortestingpurposes
objBuffer.PathToFile="../081899/random.asp"这是文件名啦。
Heresanexampleofhowtoaddanewkeywordtothekeywordarray
Youcouldaddalistofyourownfunctionnames,variablesorwhatever...cool!
NOTE:YoucanadddifferentHTMLformattingifyoulike,the<strong>
attributewillappliedtoallkeywords...thisislikelytochange
inthenearfuture.
objBuffer.AddKeyword"response.write","<fontcolor=Red>Response.Write</font>"
Hereareexamplesofchangingthetablebackgroundcolor,codecolor,
commentcolor,stringcolorandtabspaceproperties
objBuffer.TableBGColor="LightGrey"or
objBuffer.TableBGColor="#ffffdd"simpleright?
objBuffer.CodeColor="Red"
objBuffer.CommentColor="Orange"
objBuffer.StringColor="Purple"
objBuffer.TabSpaces=""
CalltheParseFilemethodofthecBufferclass,passittrueifyouwantthe
HTMLcontainedinthepageoutputorfalseifyoudont
objBuffer.ParseFileFalse注重:显现代码的response.write已在class中。这里挪用办法就能够了。
Checkforerrorsthatmayhavebeenraisedandwritethemout
IfErr.number0Then
Response.WriteErr.number&":"&Err.description&":"&Err.source&"<br>"
EndIf
Outputtheprocessingtimeandnumberoflinesprocessedbythescript
Response.Write"<strong>ProcessingTime:</strong>"&objBuffer.ProcessingTime&"seconds<br>"
Response.Write"<strong>LinesProcessed:</strong>"&objBuffer.LineCount&"<br>"
DestroytheinstanceofourcBufferclass
SetobjBuffer=Nothing
%>
</p>对于中小型web应用来说,php有很强的竞争力,linux+apache+mysql+php(lamp)的组合几乎可以胜任绝大多数网站的解决方案,对于大型应用来讲,对于系统架构要求更高,需要有成熟的框架支持,jsp的struts是个不错的框架,国内介绍它的资料也非常多,应用逐渐广泛起来。asp就不用说了, |
|