ASP网页编程之asp的ubb函数
Windows本身的所有问题都会一成不变的也累加到了它的身上。安全性、稳定性、跨平台性都会因为与NT的捆绑而显现出来;ubb|函数asp的ubb函数(保举)functionunHtml(content)
unHtml=content
ifcontent""then
unHtml=replace(unHtml,"&","&")
unHtml=replace(unHtml,"<","<")
unHtml=replace(unHtml,">",">")
unHtml=replace(unHtml,chr(34),""")
unHtml=replace(unHtml,chr(13),"<br>")
unHtml=replace(unHtml,chr(32),"")
unHtml=ubb(unHtml)
endif
endfunction
functionubb(content)
Dimnowtime,i
ubb=content
nowtime=now()
UBB=Convert(ubb,"code")
UBB=Convert(ubb,"html")
UBB=Convert(ubb,"url")
UBB=Convert(ubb,"color")
UBB=Convert(ubb,"font")
UBB=Convert(ubb,"size")
UBB=Convert(ubb,"quote")
UBB=Convert(ubb,"email")
UBB=Convert(ubb,"img")
UBB=Convert(ubb,"swf")
UBB=AutoURL(ubb)
ubb=replace(ubb,"","<b>",1,-1,1)
ubb=replace(ubb,"","</b>",1,-1,1)
ubb=replace(ubb,"","<i>",1,-1,1)
ubb=replace(ubb,"","</i>",1,-1,1)
ubb=replace(ubb,"","<u>",1,-1,1)
ubb=replace(ubb,"","</u>",1,-1,1)
ubb=replace(ubb,"","<fontcolor=#000099>",1,-1,1)
ubb=replace(ubb,"","</font>",1,-1,1)
ubb=replace(ubb,"","<fontcolor=#990000>",1,-1,1)
ubb=replace(ubb,"","</font>",1,-1,1)
fori=1to28
ubb=replace(ubb,"{:em"&i&"}","<IMGSRC=http://www.163design.net/a/z/emot/emotface/em"&i&".gif></img>",1,6,1)
ubb=replace(ubb,"{:em"&i&"}","",1,-1,1)
next
ubb=replace(ubb,"["&chr(176),"[",1,-1,1)
ubb=replace(ubb,chr(176)&"]","]",1,-1,1)
ubb=replace(ubb,"/"&chr(176),"/",1,-1,1)
ubb=replace(ubb,"{;em","{:em",1,-1,1)
endfunction
functionConvert(ubb,CovT)
DimcText,startubb,endubb,Lcovt,text,codetext
cText=ubb
startubb=1
dowhileCovt="url"orCovt="color"orCovt="font"orCovt="size"
startubb=instr(startubb,cText,"["&CovT&"=",1)
ifstartubb=0thenexitdo
endubb=instr(startubb,cText,"]",1)
ifendubb=0thenexitdo
Lcovt=Covt
startubb=startubb+len(lCovT)+2
text=mid(cText,startubb,endubb-startubb)
codetext=replace(text,"[","["&chr(176),1,-1,1)
codetext=replace(codetext,"]",chr(176)&"]",1,-1,1)
codetext=replace(codetext,"{:em","{;em",1,-1,1)
codetext=replace(codetext,"/","/"&chr(176),1,-1,1)
selectcaseCovT
case"color"
cText=replace(cText,"","<fontcolor="&text&">",1,1,1)
cText=replace(cText,"","</font>",1,1,1)
case"font"
cText=replace(cText,"","<fontface="&text&">",1,1,1)
cText=replace(cText,"","</font>",1,1,1)
case"size"
ifIsNumeric(text)then
iftext>6thentext=6
iftext<1thentext=1
cText=replace(cText,"","<fontsize="&text&">",1,1,1)
cText=replace(cText,"","</font>",1,1,1)
endif
case"url"
cText=replace(cText,"","<ahref="&codetext&"target=_blank>",1,1,1)
cText=replace(cText,"","</a>",1,1,1)
case"email"
cText=replace(cText,"["&CovT&"="&text&"]","<ahref=mailto:"&text&">",1,1,1)
cText=replace(cText,"[/"&CovT&"]","</a>",1,1,1)
endselect
loop
startubb=1
do
startubb=instr(startubb,cText,"["&CovT&"]",1)
ifstartubb=0thenexitdo
endubb=instr(startubb,cText,"[/"&CovT&"]",1)</p>想法是和程序员的想法不一样的.至于为什么.大家去想一想.跟心理学有关的 虽然ASP也有很多网络教程。但是这些都不系统。都是半路出家,只是从一个例子告诉你怎么用。不会深入讨论,更不会将没有出现在例子里的方法都一一列举出来。 你可以通过继承已有的对象最大限度保护你以前的投资。并且C#和C++、Java一样提供了完善的调试/纠错体系。 他的语法和设计思路和VB完全相同,导致很多ASP的书都留一句“相关内容请参考VB的相关教材....”更糟糕的是,相当多的ASP教程混合了Javascript,VBscript等等脚本语言,搞的初学者。 Session:这个存储跟客户端会话过程的数据,默认20分钟失效 用户端的浏览器不需要提供任何别的支持,这样大提高了用户与服务器之间的交互的速度。 下面简单介绍一下我学习ASP的方法,希望对想学习ASP的朋友有所帮助... 兴趣爱好,那么你无须学编程,申请一个域名和空间,在网上下载一些免费开源的CMS系统,你不用改代码,只须熟悉它们的后台操作,像office一样简单方便,很快就能建一个站点,很多站长都是这样做的 虽然ASP也有很多网络教程。但是这些都不系统。都是半路出家,只是从一个例子告诉你怎么用。不会深入讨论,更不会将没有出现在例子里的方法都一一列举出来。
页:
[1]