|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
使用filesystemobject,可以对服务器上的文件进行操作,浏览、复制、移动、删除等。有ado的支持,asp对数据库的操作非常得心应手。你甚至可以像使用本地数据库那样,管理远程主机上的数据库,对表格、记录进行各种操作。年夜写|函数功效申明:
能够把文章题目中的英文单词的首字母酿成年夜写:)
效果演示:
<%
functionPCase(strInput)
Variabledeclaration.
DimstrArr
DimtmpWord
DimtmpString
Dimlast
CreateanarrayTostoreEachwordIntheStringseparately.
strArr=split(strInput,"")
ifubound(strArr)>0Then
Forx=lbound(strArr)Toubound(strArr)
SetEachwordTolowerCaseinitially.
strArr(x)=LCase(strArr(x))
Skiptheunimportantwords.
SelectCasestrArr(x)
Case"a"
Case"an"
Case"and"
Case"but"
Case"by"
Case"for"
Case"in"
Case"into"
Case"is"
Case"of"
Case"off"
Case"on"
Case"onto"
Case"or"
Case"the"
Case"to"
Case"a.m."
strArr(x)="A.M."
Case"p.m."
strArr(x)="P.M."
Case"b.c."
strArr(x)="B.C."
Case"a.d."
strArr(x)="A.D."
CaseElse
Capitalizethefirstletter,butdontforgetTotakeintoaccountthat
theStringmaybeinSingleorDoublequotes.
iflen(strArr(x))>1Then
ifmid(strArr(x),1,1)=""ormid(strArr(x),1,1)=""""Then
tmpWord=mid(strArr(x),1,1)&Ucase(mid(strArr(x),2,1))&mid(strArr(x),3,len(strArr(x))-2)
Else
tmpWord=Ucase(mid(strArr(x),1,1))&mid(strArr(x),2,len(strArr(x))-1)
Endif
strArr(x)=tmpWord
Endif
EndSelect
TheunimportantwordsmayneedTobecapitalizediftheyfollowadash,colon,
semi-colon,SinglequoteorDoublequote.
ifx>0Then
ifinstr(strArr(x-1),"-")_
orinstr(strArr(x-1),":")_
orinstr(strArr(x-1),";")Then
tmpWord=Ucase(mid(strArr(x),1,1))&mid(strArr(x),2,len(strArr(x))-1)
strArr(x)=tmpWord
Endif
Endif
Next
Else
strArr(0)=LCase(strArr(0))
Endif
MakesurethefirstwordInthearrayisuppercase,butdontforgetTotakeintoaccount
thattheStringmaybeinSingleorDoublequotes.
ifmid(strArr(0),1,1)=""ormid(strArr(0),1,1)=""""Then
tmpWord=mid(strArr(0),1,1)&Ucase(mid(strArr(0),2,1))&mid(strArr(0),3,len(strArr(0))-2)
Else
tmpWord=Ucase(mid(strArr(0),1,1))&mid(strArr(0),2,len(strArr(0))-1)
Endif
strArr(0)=tmpWord
Also,makesurethelastwordInthearrayisuppercase,butdontforgetTotakeintoaccount
thattheStringmaybeinSingleorDoublequotes.
last=ubound(strArr)
ifmid(strArr(last),1,1)=""ormid(strArr(last),1,1)=""""Then
tmpWord=mid(strArr(last),1,1)&Ucase(mid(strArr(last),2,1))&mid(strArr(0),3,len(strArr(last))-2)
Else
tmpWord=Ucase(mid(strArr(last),1,1))&mid(strArr(last),2,len(strArr(last))-1)
Endif
strArr(last)=tmpWord
RebuildthewholeStringfromthearrayparts.
Forx=lbound(strArr)Toubound(strArr)
tmpString=tmpString&strArr(x)&""
Next
PCase=tmpString
Endfunction
%>
</p>结论:和PHP一样,ASP简单而易于维护,很适合小型网站应用,通过DCOM和MTS技术,ASP甚至还可以完成小规模的企业应用,但ASP的致命缺点就是不支持跨平台的系统,在大型项目开发和维护上非常困难。 |
|