<%
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,"<body"),instr(result,"</body>"))
result=replace(result,"</body>","")
result=mid(result,instr(result,">")+1)
‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’
‘’‘’以下,把所有打开文件中的连接转换
‘’‘’<a href="c.html">---><a href="show.asp?tar=c.html">
‘’‘’ 或---><a href="show.asp?tar=a/b/c.html">
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 "<pre>" & result & "</pre>"
%>
文章来源于领测软件测试网 https://www.ltesting.net/










