您现在的位置是:网站首页> 编程资料编程资料
asp中获取内容中所有图片与获取内容中第一个图片的代码_应用技巧_
2023-05-25
242人已围观
简介 asp中获取内容中所有图片与获取内容中第一个图片的代码_应用技巧_
复制代码 代码如下:
'=====================================
'获取内容中所有图片
'=====================================
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="
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&""
End IF
Next
End IF
End IF
Get_ImgSrc=t1
Set Matches=Nothing
Set Regs=Nothing
End Function
'=====================================
'获取内容中第一个图片
'=====================================
Function Frist_Pic(ByVal t0)
Frist_Pic=""
Dim Regs,Matches
Set Regs=New RegExp
Regs.Ignorecase=True
Regs.Global=True
Regs.Pattern="
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
相关内容
- 获取一个数字的个位、十位、百位的函数代码_应用技巧_
- ASP同一站点下gb2312和utf-8页面传递参数乱码的终极解决方法_应用技巧_
- ASP中使用Set ors=oConn.Execute()时获取记录数的方法_应用技巧_
- ASP的URLDecode函数URLEncode解码函数_应用技巧_
- asp空间判断jmail组件是否安装或支持的代码_应用技巧_
- asp中判断服务器是否安装了某种组件的函数_应用技巧_
- asp 页面允许CACHE的方法_应用技巧_
- 做了CDN加速的ASP网站获取用户真实IP程序_应用技巧_
- asp获取远程网页的指定内容的实现代码_小偷/采集_
- asp中去除html中style,javascript,css代码_应用技巧_
