网址和邮件地址的转换函数
<%
FunctionurConvert(Str)
convertstr = str
urllocation = instr(convertstr,“ http://”)
if(urllocation = 0)和(maillocation = 0),则
urlConvert = convertstr
出口
Endif
ifurllocation <> 0
rutightr = str
dowhileurllocation <> urllocationEnd
urllocation = instr(rutighttr,“ http://”)
urllocationEnd = instrrev(rutightr,“ http://”)
finalStr = finalalstr&left(righttr,urllocation-1)
MIDURLSTR = MIDTR(Righttr,Urllocation+1,1)
dowhile(ASC(MIDURLSTR)> = 45)和(ASC(MIDURLSTR)<= 126)
loopint = loopint+1
MIDURLSTR = MIDTR(righttr,urllocation+loopint,1)
ifmidurlstr =“” thenexitdo
环形
endurlstr = midtr(righttr,urllocation,loopint)
urlstr =“ <ahref =”&endurlstr&“>”&endurlstr&“ </a>”
righttr = midtr(rutighttr,urllocation+loopint)
finalStr = enaltrstr&urlstr
loopint = 1
环形
Endif
finaltstr = enaltalstr&rightstr
convertstr1 = enalalstr
finalStr =“”
maillocation = instr(convertstr1,“@”)
ifMaillocation <> 0
dowhilemaillocation <> maillocationEnd
maillocation = instr(convertstr1,“@”)
maillocationEnd = instrev(convertstr1,“@”)
mainmidmailstr = mid(convertstr1,maillocation+1,1)
MIDMAILSTR = mainmidmailstr
Dowhile(ASC(Midmailstr)> = 45)和(ASC(Midmailstr)<= 126)
loopint1 = loopint1+1
midmailstr = mid(convertstr1,maillocation-loopint1,1)
环形
FirstStr = MID(Convertstr1,Maillocation-loopint1+1,loopint1-1)
finalStr = finalalstr&left(convertstr1,maillocation-loopint1)
MIDMAILSTR1 = MAIMMIDMAILSTR
dowhile(ASC(MidMailStr1)> = 45)和(ASC(MidMailstr1)<= 126)
loopint2 = loopint2+1
midmailstr1 = mid(convertstr1,maillocation+loopint2,1)
ifmidmailstr1 =“” thenexitdo
环形
secondstr = mid(convertstr1,maillocation,loopint2)
endMailstr = firststr&secondstr
mailstr =“ <ahref = mailto:”&endmailstr&“>”&endmailstr&“ </a>”
finaltstr = finalalstr&mailstr
convertstr1 = mid(convertstr1,maillocation+loopint2)
loopint1 = 1
loopint2 = 1
环形
Endif
finalalstr = finalalstr&convertstr1
urlConvert = taralstr
最终功能
%>