网址和邮件地址的转换函数
<%
functionUrlConvert (str)
convertStr = str
urllocation = instr (convertStr, "http: //")
if (urllocation = 0) dan (maillocation = 0) lalu
Urlconvert = convertStr
fungsi keluar
endif
ifurllocation <> 0then
Rightstr = str
Dowhileurlocation <> urllocationend
urllocation = instr (kanan, "http: //")
urllocationEnd = instrrev (kanan, "http: //")
finalStr = finalStr & kiri (kanan, urllocation-1)
midurlstr = mid (kanan, urllocation+1,1)
Dowhile (ASC (midurlstr)> = 45) dan (ASC (midurlstr) <= 126)
loopint = loopint+1
midurlstr = mid (kanan, urllocation+loopint, 1)
ifmIdurlstr = "" ThenExitdo
lingkaran
endUrlstr = mid (kanan, urllocation, loopint)
Urlstr = "<ahref =" & endurlstr & ">" & endurlstr & "</a>"
Rightstr = mid (kanan, urllocation+loopint)
finalStr = finalStr & urlstr
loopint = 1
Lingkaran
endif
FinalStr = FinalStr & Rightstr
ConvertStr1 = FinalStr
finalstr = ""
maillocation = instr (convertStr1, "@")
ifmAillocation <> 0then
Dowhilemaillocation <> maillocationend
maillocation = instr (convertStr1, "@")
maillocateEnd = instrrev (convertStr1, "@")
MainMidMailstr = mid (convertStr1, maillocation+1,1)
midmailstr = mainmidmailstr
Dowhile (ASC (Midmailstr)> = 45) dan (ASC (Midmailstr) <= 126)
loopInt1 = loopInt1+1
midmailstr = mid (convertStr1, maillocation-loopint1,1)
lingkaran
firststr = mid (convertStr1, maillocation-loopint1+1, loopint1-1)
FinalStr = FinalStr & Left (ConvertStr1, Maillocation-LoopInt1)
midmailstr1 = mainmidmailstr
Dowhile (ASC (midmailstr1)> = 45) dan (ASC (midmailstr1) <= 126)
loopInt2 = loopInt2+1
midmailstr1 = mid (convertStr1, maillocation+loopint2,1)
ifmidmailstr1 = "" ThenExitdo
lingkaran
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
Lingkaran
endif
finalStr = finalStr & convertStr1
Urlconvert = finalStr
fungsi endfungsi
%>