建站知識

Welcome to Beijing RuiHeng TianLong Technology Co., Ltd.

asp獲取a連接,獲取代碼中的鏈接地址,asp截取文本連接地址。

時(shí)間:  來(lái)源:網(wǎng)站建設公司  作者:網(wǎng)站制作公司  點(diǎn)擊量:
asp獲取a連接,獲取代碼中的鏈接地址,asp截取文本連接地址。

VBScript code

'==================================================

'*函數名 : GetHrefFromContent

'*參數說(shuō)明 : html asp截取文本連接地址。

'*功能簡(jiǎn)介 : 獲取代碼中的鏈接地址

'==================================================

function GetHrefFromContent(html)

Dim Re, match, matchs,strContent,aryNum,aryContent,strUrl

strContent = ""

set Re = new RegExp

re.IgnoreCase =True

re.Global = True

re.Pattern = "<a.*?href=(?:""(.*?)""|(.*?))(?:(?: .*?>)|>)(.*?)</a>"

Set matchs = re.Execute(html)

for each match in matchs

'match.SubMatches(0) 基本 0 可改成數組里的其它成員

strContent = strContent + (match.SubMatches(0)) & "|$|"

next

set matchs = nothing

aryContent = split(strContent,"|$|")

for aryNum = LBound(aryContent) to UBound(aryContent)

strUrl = aryContent(aryNum) '連接地址

next

end function


asp網(wǎng)站建設的截取連接地址功能,你學(xué)會(huì )了嗎?


 

本文TAG標簽: asp網(wǎng)站制作 asp網(wǎng)站建設
返回關(guān)閉本頁(yè)
上一篇:北京網(wǎng)站建設技術(shù)答疑怎么禁止查看網(wǎng)頁(yè)源文件代碼和網(wǎng)頁(yè)防復制代碼    下一篇:在打開(kāi)網(wǎng)站時(shí)顯示的如404,500等錯誤提示是什么意思,網(wǎng)站制作中HTTP常見(jiàn)狀態(tài)代碼
推薦閱讀

Copyright © 2010-2021 北京瑞恒天龍科技有限公司  All Rights Reserved  |  北京網(wǎng)站建設知名服務(wù)商  |  北京網(wǎng)站制作 | 京ICP備11004170號-1   京公網(wǎng)安備110107000463號
地址:北京市海淀區永定路長(cháng)銀大廈B座  非工作時(shí)間:15810379666  服務(wù)熱線(xiàn):400-809-6709  版權所有 盜版必究!

在線(xiàn)咨詢(xún)
關(guān)閉
電話(huà)咨詢(xún)
網(wǎng)站制作電話(huà)
400-809-6709
JiZzJiZZ国产免费A_玖玖玖色在线精品视频_欧美韩国人成网站中文字幕_精品2022露脸国产偷人