展开全部
<%
function GetImgFromContent(html)
Dim Re, match, matchs, htm, t
htm = ""
set Re = new RegExp
re.IgnoreCase =True
re.Global = True
re.Pattern = " <img [^ <]*src=""(.*)""[^>]*>"
Set matchs = re.Execute(html)
for each match in matchs
htm = htm + (match.SubMatches(0)) & "|$|"
next
if htm="" then
GetImgFromContent="img/W020091010368958908816.jpg"
else
set matchs = nothing
t = split(htm, "|$|")(0)
if len(t) = 0 or t = "" then
GetImgFromContent=""
end if
GetImgFromContent =t
end if
end function
%> 这儿可以设置t = split(htm, "|$|")(0)
0表示提取的是第一张,自己改改吧
function GetImgFromContent(html)
Dim Re, match, matchs, htm, t
htm = ""
set Re = new RegExp
re.IgnoreCase =True
re.Global = True
re.Pattern = " <img [^ <]*src=""(.*)""[^>]*>"
Set matchs = re.Execute(html)
for each match in matchs
htm = htm + (match.SubMatches(0)) & "|$|"
next
if htm="" then
GetImgFromContent="img/W020091010368958908816.jpg"
else
set matchs = nothing
t = split(htm, "|$|")(0)
if len(t) = 0 or t = "" then
GetImgFromContent=""
end if
GetImgFromContent =t
end if
end function
%> 这儿可以设置t = split(htm, "|$|")(0)
0表示提取的是第一张,自己改改吧
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询