
从MySQL 数据库中 某个表 某个字段里 字符串中提取 图片地址的 ASP 代码,把图片打印出来
<%strtemp=rs("hxjs")find_img(strtemp)functionfind_img(strtemp)dimarrtempdimi,url_gif,...
<%strtemp=rs("hxjs")
find_img(strtemp)
function find_img(strtemp)
dim arrtemp
dim i,url_gif,num_gif,url_jpg,num_jpg,url_png,num_png,url_other,num_other
arrtemp=split(strtemp,"<img")
if Ubound(arrtemp)<=0 then response.Write "没有检测到图片标识" : exit function
'response.Write "一共检测到图片标识数量:"&Ubound(arrtemp)&"<br>"
for i=1 to Ubound(arrtemp)
temp=cutstr(cutstr(cutstr(arrtemp(i),"right"," />"),"left","src="""),"right","""")
ext=Ucase(right(temp,4))
select case ext
case ".GIF"
url_gif = url_gif&"|"&temp
num_gif = num_gif + 1
case ".JPG"
url_jpg = url_jpg&"|"&temp
num_jpg = num_jpg + 1
case ".PNG"
url_png = url_png&"|"&temp
num_png = num_png + 1
case else
url_other = url_other&"|"&temp
num_other = num_other + 1
end select
next
response.Write ""&replace(url_gif,"|","<br>")
response.Write ""&replace(url_jpg,"|","<br>")
response.Write ""&replace(url_png,"|","<br>")
response.Write ""&replace(url_other,"|","<br>")
end function
function cutstr(temp,direct,str)
if direct="right" then
cutstr = left(temp,instr(temp,str)-1)
else
cutstr = right(temp,len(temp)-instr(temp,str)-len(str)+1)
end if
end function
%>把查询出来的图片写到网页里面怎么写出来? 展开
find_img(strtemp)
function find_img(strtemp)
dim arrtemp
dim i,url_gif,num_gif,url_jpg,num_jpg,url_png,num_png,url_other,num_other
arrtemp=split(strtemp,"<img")
if Ubound(arrtemp)<=0 then response.Write "没有检测到图片标识" : exit function
'response.Write "一共检测到图片标识数量:"&Ubound(arrtemp)&"<br>"
for i=1 to Ubound(arrtemp)
temp=cutstr(cutstr(cutstr(arrtemp(i),"right"," />"),"left","src="""),"right","""")
ext=Ucase(right(temp,4))
select case ext
case ".GIF"
url_gif = url_gif&"|"&temp
num_gif = num_gif + 1
case ".JPG"
url_jpg = url_jpg&"|"&temp
num_jpg = num_jpg + 1
case ".PNG"
url_png = url_png&"|"&temp
num_png = num_png + 1
case else
url_other = url_other&"|"&temp
num_other = num_other + 1
end select
next
response.Write ""&replace(url_gif,"|","<br>")
response.Write ""&replace(url_jpg,"|","<br>")
response.Write ""&replace(url_png,"|","<br>")
response.Write ""&replace(url_other,"|","<br>")
end function
function cutstr(temp,direct,str)
if direct="right" then
cutstr = left(temp,instr(temp,str)-1)
else
cutstr = right(temp,len(temp)-instr(temp,str)-len(str)+1)
end if
end function
%>把查询出来的图片写到网页里面怎么写出来? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |