主頁 > 知識庫 > asp中獲取內(nèi)容中所有圖片與獲取內(nèi)容中第一個圖片的代碼

asp中獲取內(nèi)容中所有圖片與獲取內(nèi)容中第一個圖片的代碼

熱門標簽:電子圍欄 服務(wù)器配置 科大訊飛語音識別系統(tǒng) 團購網(wǎng)站 Mysql連接數(shù)設(shè)置 Linux服務(wù)器 阿里云 銀行業(yè)務(wù)
復(fù)制代碼 代碼如下:

'=====================================
'獲取內(nèi)容中所有圖片
'=====================================
Function Get_ImgSrc(ByVal t0)
Dim t1,Regs,Matches,Match
t1=""
IF Not(IsNull(t0) Or Len(t0)=0) Then
Set Regs=New RegExp
Regs.Pattern="img[^>]+src=""([^"">]+)""[^>]*>"
Regs.Ignorecase=True
Regs.Global=True
Set Matches=Regs.Execute(t0)
IF Matches.Count>0 Then
For Each Match In Matches
IF Left(Match.SubMatches(0),7)>"http://" Then
t1=t1"option value="""Match.SubMatches(0)""">"Match.SubMatches(0)"/option>"
End IF
Next
End IF
End IF
Get_ImgSrc=t1
Set Matches=Nothing
Set Regs=Nothing
End Function

'=====================================
'獲取內(nèi)容中第一個圖片
'=====================================
Function Frist_Pic(ByVal t0)
Frist_Pic=""
Dim Regs,Matches
Set Regs=New RegExp
Regs.Ignorecase=True
Regs.Global=True
Regs.Pattern="img[^>]+src=""([^"">]+)""[^>]*>"
Set Matches=Regs.Execute(t0)
IF Regs.test(t0) Then
Frist_Pic=Matches(0).SubMatches(0)
End IF
Set Matches=Nothing
Set Regs=Nothing
End Function

標簽:萍鄉(xiāng) 衢州 蚌埠 江蘇 衡水 棗莊 大理 廣元

巨人網(wǎng)絡(luò)通訊聲明:本文標題《asp中獲取內(nèi)容中所有圖片與獲取內(nèi)容中第一個圖片的代碼》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266