繁体中文
设为首页
加入收藏
当前位置:ASP技术首页 >> ASP基础 >> 简单析取html文件实例

简单析取html文件实例

2006-07-15 08:00:00  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
简介:用offline下载了一些小说,放在局域网上,想用自己设计的页面显示,内容放在一个table中,如果取全部HTML,会有效果问题,因此只取 之间的,代码如下:
关键字:实例 简单 文件 html

用offline下载了一些小说,放在局域网上,想用自己设计的页面显示,内容放在一个table中,如果取全部HTML,会有效果问题,因此只取 之间的,代码如下:

<%

dim filepath

filepath=replace(Request.QueryString ("tar"),chr(34),"")

filepath=Server.MapPath(filepath)

set x=server.CreateObject ("Scripting.FileSystemObject")

set y=x.OpenTextFile (filepath,1,false)

result=y.readall()

y.close

set y=nothing

set x=nothing

'end if

result=lcase(result)

''''''''''''''''''''''''

result=mid(result,instr(result,""))

result=replace(result,"","")

result=mid(result,instr(result,">")+1)

''''''''''''''''''''''''

''以下,把所有打开文件中的连接转换

''--->

'' 或--->

if instr(request.querystring("tar"),"/")<>0 then

dim temp

temp=left(request.querystring("tar"),instrrev(request.querystring("tar"),"/"))

result=replace(result,"href=../../" & chr(34),"href=../../" & chr(34) & "show.ASP?tar=" & temp)

else

''

result=replace(result,"href=../../" & chr(34),"href=../../" & chr(34) & "show.ASP?tar=")

end if

Response.Write "

" & result & "
"

%>

相关文章