最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

 更新時間:2011年01月05日 23:48:42   作者:  
用asp獲取內(nèi)容中的圖片與獲取內(nèi)容中的第一個圖片地址,主要是cms中保存內(nèi)容中的圖片需要用得到,使用的是正則的方法。
復(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

相關(guān)文章

最新評論

平谷区| 宜兰县| 松潘县| 浑源县| 定州市| 克东县| 达拉特旗| 泰和县| 农安县| 含山县| 南通市| 定州市| 隆尧县| 阆中市| 抚顺县| 湾仔区| 小金县| 饶平县| 赞皇县| 夏邑县| 南溪县| 灌阳县| 尖扎县| 孝感市| 封开县| 阳原县| 友谊县| 阿克陶县| 北宁市| 科技| 卢湾区| 和顺县| 手游| 太原市| 哈尔滨市| 建瓯市| 陆河县| 教育| 万山特区| 桂东县| 交口县|