这代码在干什么?帮忙解释下

if trim(Application("ConnectionString"))="" or trim(Application("ConnectionString"))<>"driver={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("bvnews.asp") & ";uid=;PWD=;" then
Application("ConnectionString")="driver={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("bvnews.asp") & ";uid=;PWD=;"
end if
Function LinkURLs(strInput)
Dim iCurrentLocation
Dim iLinkStart
Dim iLinkEnd
Dim strLinkText
Dim strOutPut

strLinkText=""
strOutput=""
iCurrentLocation=1
Do while Instr(iCurrentLocation,strInput,"[url]",1)<>0
iLinkStart=Instr(iCurrentLocation,strInput,"[url]",1)
iLinkEnd=Instr(iCurrentLocation+1,strInput,"[/url]",1)
If iLinkEnd=0 then iLinkEnd=len(strINput)+1
select case Mid(strInput,iLinkEnd-1,1)
case ".","!","?"
iLinkEnd=iLinkEnd-1
end select
stroutput=strOutput & Mid(strInput,iCurrentLocation,iLinkStart-iCurrentLocation)
strLinkText=replace(Mid(strInput,iLinkStart+5,iLinkEnd-iLinkStart-5),"[/url]","")
strOutput=strOutput & "<A href=""" & strLinkText & """ target=_blank><font color=blue>" & strLinkText & "</font></A>"
iCurrentLocation=iLinkEnd
Loop

strOutput=strOutput & Mid(strInput,iCurrentLocation)
LinkURLs=replace(strOutput,"[/url]","",1,-1,1)
End Function

Function LinkIMGs(strInput)
Dim iCurrentLocation
Dim iLinkStart
Dim iLinkEnd
Dim strLinkText
Dim strOutPut

strLinkText=""
strOutput=""
iCurrentLocation=1
Do while Instr(iCurrentLocation,strInput,"[img]",1)<>0
iLinkStart=Instr(iCurrentLocation,strInput,"[img]",1)
iLinkEnd=Instr(iCurrentLocation+1,strInput,"[/img]",1)
If iLinkEnd=0 then iLinkEnd=len(strINput)+1
select case Mid(strInput,iLinkEnd-1,1)
case ".","!","?"
iLinkEnd=iLinkEnd-1
end select
stroutput=strOutput & Mid(strInput,iCurrentLocation,iLinkStart-iCurrentLocation)
strLinkText=replace(Mid(strInput,iLinkStart+5,iLinkEnd-iLinkStart-5),"[/img]","")
strOutput=strOutput & "<img src=""" & strLinkText & """>"
iCurrentLocation=iLinkEnd
Loop

strOutput=strOutput & Mid(strInput,iCurrentLocation)
LinkIMGs=replace(strOutput,"[/img]","",1,-1,1)
End Function

繁星coding
浏览 118回答 1
1回答

鸿蒙传说

if trim(Application("ConnectionString"))="" or trim(Application("ConnectionString"))<>"driver={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("bvnews.asp") & ";uid=;PWD=;" thenApplication("ConnectionString")="driver={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("bvnews.asp") & ";uid=;PWD=;"end if//////////// 这里在链接数据库Function LinkURLs(strInput)Dim iCurrentLocationDim iLinkStartDim iLinkEndDim strLinkTextDim strOutPutstrLinkText=""strOutput=""iCurrentLocation=1Do while Instr(iCurrentLocation,strInput,"[url]",1)<>0iLinkStart=Instr(iCurrentLocation,strInput,"[url]",1)iLinkEnd=Instr(iCurrentLocation+1,strInput,"[/url]",1)If iLinkEnd=0 then iLinkEnd=len(strINput)+1select case Mid(strInput,iLinkEnd-1,1)case ".","!","?"iLinkEnd=iLinkEnd-1end selectstroutput=strOutput & Mid(strInput,iCurrentLocation,iLinkStart-iCurrentLocation)strLinkText=replace(Mid(strInput,iLinkStart+5,iLinkEnd-iLinkStart-5),"[/url]","")strOutput=strOutput & "<A href=""" & strLinkText & """ target=_blank><font color=blue>" & strLinkText & "</font></A>"iCurrentLocation=iLinkEndLoopstrOutput=strOutput & Mid(strInput,iCurrentLocation)LinkURLs=replace(strOutput,"[/url]","",1,-1,1)End Function///////这个函数的作用是生成文字类的友情链接Function LinkIMGs(strInput)Dim iCurrentLocationDim iLinkStartDim iLinkEndDim strLinkTextDim strOutPutstrLinkText=""strOutput=""iCurrentLocation=1Do while Instr(iCurrentLocation,strInput,"[img]",1)<>0iLinkStart=Instr(iCurrentLocation,strInput,"[img]",1)iLinkEnd=Instr(iCurrentLocation+1,strInput,"[/img]",1)If iLinkEnd=0 then iLinkEnd=len(strINput)+1select case Mid(strInput,iLinkEnd-1,1)case ".","!","?"iLinkEnd=iLinkEnd-1end selectstroutput=strOutput & Mid(strInput,iCurrentLocation,iLinkStart-iCurrentLocation)strLinkText=replace(Mid(strInput,iLinkStart+5,iLinkEnd-iLinkStart-5),"[/img]","")strOutput=strOutput & "<img src=""" & strLinkText & """>"iCurrentLocation=iLinkEndLoopstrOutput=strOutput & Mid(strInput,iCurrentLocation)LinkIMGs=replace(strOutput,"[/img]","",1,-1,1)End Function///////这个函数是生成图片型的友情链接。
打开App,查看更多内容
随时随地看视频慕课网APP