风水高人真实故事:ASP怎样获取一段HTML代码里的图片地址?

来源:百度文库 编辑:神马品牌网 时间:2024/04/28 23:59:20
比如有一段HTML代码(图片显示的代码,图片数量不定):

<B><BR><IMG onmousewheel="return imgzoom(this);" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('../uploadfile/images/200655174548845.jpg');}" src="../uploadfile/images/200655174548845.jpg" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>

<BR>

<IMG onmousewheel="return imgzoom(this);" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('../uploadfile/images/200655174548845.jpg');}" src="../uploadfile/images/200655174548845.jpg" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>

上面代码图片显示的数量不定,也许有10几张,现在我想通过ASP编写一段代码,不管有多少张图片,让它自动将第一张图片的URL获取出来,也就是“src="../uploadfile/images/200655174548845.jpg" onload”中src=""两个引号间的图片地址取出来,请高手帮忙写这段代码,15分奖励!
楼下的大哥可能没听完全明白我的意思,我只想取第一张图片的完整URL,就是第一个src=""两个引号中间的图片地址../uploadfile/images/200655174548845.jpg

读取html你会吧

读取的html用htmlpage命名
然后用
left(right(htmlpage,instr(1,htmlpage,"window.open('../",0)),instr(1,htmlpage,"""",0))

自己理解一下
解释找到window.open('../和"直接的代码

instr
和left right len
等函数。

好强啊,是不是想用别人的图片,让程序自动找啊?强