为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

繁星coding 2022-07-14 17:11:34
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 ifFunction 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 FunctionFunction 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
查看完整描述

1 回答

?
鸿蒙传说

TA贡献1865条经验 获得超7个赞

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

///////这个函数是生成图片型的友情链接。



查看完整回答
反对 回复 2022-07-18
  • 1 回答
  • 0 关注
  • 117 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信