网址和邮件地址的转换函数
<%
functionurlconvert (str)
convertstr = str
Urllocation = Instr (convertstr, "http: //")
if (urllocation = 0) e (maillocation = 0) então
Urlconvert = convertStr
saída de saída
endif
ifurllocation <> 0then
RightStr = str
Dowhileurllocation <> urllocationend
Urllocation = Instr (RightStr, "http: //")
urllocationEnd = Instrrev (RightStr, "http: //")
Finalstr = Finalstr & Left (RightStr, Urllocation-1)
MIDURLSTR = MID (RightStr, Urllocation+1,1)
Dowhile (ASC (Midurlstr)> = 45) e (ASC (Midurlstr) <= 126)
loopint = loopint+1
MIDURLSTR = MID (RightStr, Urllocation+Loopint, 1)
ifmidurlstr = "" ThenExitdo
laço
endurlstr = mid (rightstr, urllocation, loopint)
Urlstr = "<ahref =" & endurlstr & ">" & endurlstr & "</a>"
RightStr = Mid (RightStr, Urllocation+Loopint)
Finalstr = Finalstr & Urlstr
loopint = 1
Laço
endif
Finalstr = Finalstr & RightStr
convertStr1 = Finalstr
Finalstr = ""
Maillocation = Instr (convertstr1, "@")
Ifmaillocation <> 0then
Dowhilemaillocation <> Maillocationend
Maillocation = Instr (convertstr1, "@")
maillocationEnd = Instrrev (convertstr1, "@")
mainmidmailstr = MID (convertstr1, mailocação+1,1)
Midmailstr = MainMidmailstr
Dowhile (ASC (Midmailstr)> = 45) e (ASC (Midmailstr) <= 126)
loopint1 = loOOPINT1+1
Midmailstr = MID (convertStr1, maillocation-loopint1,1)
laço
FirstSTR = MID (convertStr1, maillocation-loopint1+1, loopint1-1)
Finalstr = Finalstr & Left (convertStr1, Maillocation-Loopint1)
Midmailstr1 = MainMidMailstr
Dowhile (ASC (Midmailstr1)> = 45) e (ASC (Midmailstr1) <= 126)
loopint2 = loOOPINT2+1
Midmailstr1 = MID (convertStr1, Maillocation+LoOopint2,1)
ifmidmailstr1 = "" ThenExitdo
laço
SecondStr = MID (convertStr1, Maillocation, loopint2)
endMailstr = Firststr & SecondStr
Mailstr = "<Ahref = Mailto:" & endmailstr & ">" & endmailstr & "</a>"
Finalstr = Finalstr & Mailstr
convertStr1 = MID (convertStr1, maillocation+loopint2)
loopint1 = 1
loopint2 = 1
Laço
endif
Finalstr = Finalstr & convertStr1
Urlconvert = finalalstr
Função final
%>