网址和邮件地址的转换函数
<%
functionUrlConvert (str)
ConverttStr = str
urllocation = instrtstr, "http: //")
if (urllocation = 0) и (maillocation = 0) then
UrlConvert = ConverttStr
Выходная функция
эндиф
ifurllocation <> 0then
rightstr = str
Dowhileurllocation <> urllocationend
urllocation = instr (rightstr, "http: //")
urllocationend = instrrev (rightstr, "http: //")
FinalStr = FinalStr & Left (Rightstr, Urllocation-1)
MidUrlstr = Mid (Rightstr, Urlllocation+1,1)
Dowhile (ASC (MidUrlstr)> = 45) и (ASC (MidUrlstr) <= 126)
Loopint = Loopint+1
MidUrlstr = Mid (Rightstr, urlllocation+Loopint, 1)
ifmidurlstr = "" ThenExitDo
петля
endurlstr = mid (rightstr, urlllocation, loopint)
Urlstr = "<ahref =" & endurlstr & ">" & endurlstr & "</a>"
rightstr = mid (rightstr, urlllocation+loopint)
FinalStr = Finalstr & Urlstr
Loopint = 1
Петля
эндиф
FinalStr = Finalstr & Rightstr
ConverttStr1 = FinalStr
FinalStr = ""
Maillocation = instr (ConvertStr1, "@")
Ifmaillocation <> 0then
Dowhilemaillocation <> Maillocationend
Maillocation = instr (ConvertStr1, "@")
maillocationend = instrrev (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 = FINALSTR & LEFT (ConvertStr1, Maillocation-Loopint1)
Midmailstr1 = Mainmidmailstr
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>"
FinalStr = Finalstr & Mailstr
ConverttStr1 = Mid (ConverttStr1, Maillocation+Loopint2)
Loopint1 = 1
Loopint2 = 1
Петля
эндиф
FINALSTR = FINALSTR & ConvertStr1
Urlconvert = finalstr
конечная функция
%>