网址和邮件地址的转换函数
<%
functionurlconvert(str)
convertStr = str
urllocation = struntStr(convertStr、 "http://")
if(urllocation = 0)および(maillocation = 0)then
urlconvert = convertStr
exitFunction
endif
ifurllocation <> 0then
rightstr = str
dowhileurllocation <> urllocationEnd
urllocation = strunt(rightstr、 "http://")
urllocationEnd = instrrev(rightstr、 "http://")
FinalStr = FinalStr&Left(rightstr、urllocation-1)
Midurrstr = Mid(rightstr、urllocation+1,1)
Dowhile(ASC(Midurstr)> = 45)および(ASC(Midurstr)<= 126)
loopint = loopint+1
Midurrstr = Mid(rightstr、urllocation+loopint、1)
ifmidurlst = "" thenexitdo
ループ
endurlstr = Mid(rightstr、urllocation、loopint)
urlstr = "<ahref ="&endurlstr& ">"&endurlstr& "</a>"
rightstr = mid(righttr、urllocation+loopint)
FinalStr = FinalStr&URLSTR
loopint = 1
ループ
endif
FinalStr = FinalStr&rightstr
ConvertStr1 = FinalStr
FinalStr = ""
maillocation = strunt(convertStr1、 "@")
ifmaillocation <> 0then
dowhilemaillocation <> maillocationEnd
maillocation = strunt(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
convertStr1 = MID(convertStr1、maillocation+loopint2)
loopint1 = 1
loopint2 = 1
ループ
endif
FinalStr = FinalStr&ConvertStr1
urlconvert = finalStr
エンド機能
%>