|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
大家可以自己去看一看.可以说看得想呕吐.以前有次下了个动网来看.里面连基本内置函数的保护措施(函数没防御性)都没有.难怪经常补这个补那个了.可能现在.NET版会好点吧<html>
<head>
<title>将全角转为半角,半角转为全角</title>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
</head>
<bodybgcolor="#FFFFFF">
<%
---------------------------------------
编写:johnsunEmail:zjs@dagongbao.com
言语:ASP+VBScript转摘请保存版权申明
direction:"1"年夜写转小写;"-1"小写转年夜写
---------------------------------------
dimcontentA,contentB
contentA=request.form("contentA")
ifcontentA""then
CALLcontentstr(contentA,"1")
endif
contentB=request.form("contentB")
ifcontentB""then
CALLcontentstr(contentB,"-1")
endif
functioncontentstr(content,direction)
dimstrbig,tstrbig,strsma,tstrsma
strbig="ABCDEFGHIJKLMNOPQRSTUVWXYZ'"
tstrbig="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
strsma="abcdefghijklmnopqrstuvwxyz"
tstrsma="abcdefghijklmnopqrstuvwxyz"
dimb(26),tb(26),s(25),ts(25)
fori=1to26
b(i-1)=mid(strbig,i,1)
tb(i-1)=mid(tstrbig,i,1)
ifdirection="1"then
content=replace(content,b(i-1),tb(i-1))
elseifdirection="-1"then
content=replace(content,tb(i-1),b(i-1))
endif
s(i-1)=mid(strsma,i,1)
ts(i-1)=mid(tstrsma,i,1)
ifdirection="1"then
content=replace(content,s(i-1),ts(i-1))
elseifdirection="-1"then
content=replace(content,ts(i-1),s(i-1))
endif
next
-------------------------------------------
content=replace(content,chr(13)&chr(10),"<br>")
ifdirection="1"then
content=replace(content," ","")
else
content=replace(content,""," ")
endif
-------------------------------------------
contentstr=content
ifdirection="1"then
response.write"年夜写转小写:<br>"
else
response.write"小写转年夜写:<br>"
endif
response.writecontentstr&"<BR>"
endfunction
%>
<formaction=d.aspmethod="post">
年夜写转小写:
<textareaname="contentA"rows="8"cols="30">
Aladysaidtoherfriendthatthesunisthemostbeautifulandusefulbody。
Agentlmananswered:“Yes,Madam,thesunisaveryfinebody,butinmyopinion,itisnotsousefulasthemoom.”
“Why?”askedthelady.
“Because,”repliedthegentleman,“themoonaffordsuslightinthemight-time,whenwereallywantit,whereaswehavethesunalwayswithusintheday-time,whenwehavenotsomuchmeedofit.”</textarea>
<br>
小写转年夜写:
<textareaname="contentB"rows="8"cols="30">
ArcticExplorerBoy:Dad,whenIgrowupIwanttobeanArcticExplorer.
Father:That'sfine,Bill.
Boy:ButIwanttogointotrainingatonce.
Father:Andsot
Boy:Well,Iwantadollaradayforice-creamsoI'llgetusedtothecold.
</textarea>
<br>
<inputtype="submit"name="Submit"value="Submit">
</form>
</body>
</html></p>强大的可扩展性。ASP具有强大的扩展性,可以实现与多种网络、硬件设备的连接:通过专用的通讯线路远程接入企业;通过远程拨号服务器为远程拨号客户提供服务;通过WAP为移动电话互联网客户服务。 |
|