有一框架页面,包含网页A和网页B,请问在网页A中如何获取网页B的源文件?

lbx972 2004-10-29 07:04:33
谢谢 ~
...全文
128 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
ccm1980 2004-10-30
  • 打赏
  • 举报
回复
使用FSO读取文件内容的函数
function FSOFileRead(filename)
Dim objFSO,objCountFile,FiletempData
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objCountFile = objFSO.OpenTextFile(Server.MapPath(filename),1,True)
FSOFileRead = objCountFile.ReadAll
objCountFile.Close
Set objCountFile=Nothing
Set objFSO = Nothing
End Function
18.使用FSO读取文件某一行的函数
function FSOlinedit(filename,lineNum)
if linenum < 1 then exit function
dim fso,f,temparray,tempcnt
set fso = server.CreateObject("scripting.filesystemobject")
if not fso.fileExists(server.mappath(filename)) then exit function
set f = fso.opentextfile(server.mappath(filename),1)
if not f.AtEndofStream then
tempcnt = f.readall
f.close
set f = nothing
temparray = split(tempcnt,chr(13)&chr(10))
if lineNum>ubound(temparray)+1 then
exit function
else
FSOlinedit = temparray(lineNum-1)
end if
end if
end function

19.使用FSO写文件某一行的函数
function FSOlinewrite(filename,lineNum,Linecontent)
if linenum < 1 then exit function
dim fso,f,temparray,tempCnt
set fso = server.CreateObject("scripting.filesystemobject")
if not fso.fileExists(server.mappath(filename)) then exit function
set f = fso.opentextfile(server.mappath(filename),1)
if not f.AtEndofStream then
tempcnt = f.readall
f.close
temparray = split(tempcnt,chr(13)&chr(10))
if lineNum>ubound(temparray)+1 then
exit function
else
temparray(lineNum-1) = lineContent
end if
tempcnt = join(temparray,chr(13)&chr(10))
set f = fso.createtextfile(server.mappath(filename),true)
f.write tempcnt
end if
f.close
set f = nothing
end function
fightgod100 2004-10-29
  • 打赏
  • 举报
回复
fso,或者xmlhttp~~~
cuixiping 2004-10-29
  • 打赏
  • 举报
回复
如果AB同域,则可以直接通过Dom读取:
例如 parent.document.frames["B"].documentElement.outerHTML
如果AB不同域,则可以通过XMLHTTP读取:
http://community.csdn.net/Expert/ForumList_Search.asp?searchtype=2&bigclassid=3&smallclassid=301&searchKeys=XMLHTTP&tabletype=now
chenxuchen 2004-10-29
  • 打赏
  • 举报
回复
那就用fso来实现啊
filepath=server.mappath("b页面的文件名")
set fs=server.createobject(scripting.filesystemobject)
set fsfile=fs.opentextfile(filepath,1)
do while not fsfile.atendofstream
thisfile=thisfile+server.htmlencode(rsfile.readline)+"<br>"
loop
response.write thisfile
把这段代码放到A页面中
lbx972 2004-10-29
  • 打赏
  • 举报
回复
是在A中显示B的源代码~
主要是想获取了B的源代码,然后筛选里面的网址出来!
lbx972 2004-10-29
  • 打赏
  • 举报
回复
是在A中显示B的源代码~
hnzhangyls 2004-10-29
  • 打赏
  • 举报
回复
不解楼主什么意思
chenxuchen 2004-10-29
  • 打赏
  • 举报
回复
你的意思是在A中显示B的源代码吗

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧