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

lbx972 2004-10-29 07:04:33
谢谢 ~
...全文
135 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用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的源代码吗
资源下载链接为: https://pan.quark.cn/s/abbae039bf2a 在计算机科学领域,编译原理是研究如何将编程语言转化为机器可执行代码的理论基础。其,三地址代码(Three-Address Code,TAC)作为一种间表示形式,在编译器设计经常被使用,尤其是在生成目标代码的阶段。本文将深入探讨三地址代码的概念、生成器的工作原理及其在编译过程的作用。 三地址代码是一种简单的低级抽象语法树(AST)表示,每条指令涉及三个操作数,通常包括两个源操作数和一个目的操作数。这种格式简化了代码优化和目标代码生成的复杂性。例如,一个简单的算术表达式“x = y + z”在三地址代码可能表示为: 在这个例子,“t1”是一个临时变量,存储了“y + z”的结果,然后这个结果被赋值给“x”。 生成三地址代码的过程通常发生在编译器的间阶段,即语法分析之后,语义分析之前。这个阶段称为“代码生成”或“间代码生成”。编译器通过词法分析器处理源代码,将其转化为标记流;接着,语法分析器根据上下文无关文法将标记流解析成抽象语法树。三地址代码生成器就是在这个阶段介入,它遍历AST,为每个节点生成对应的三地址指令。 在Turbo C3.0这样的编译器环境下,开发者可以实现自己的三地址代码生成器。虽然Turbo C3.0是一款较老的编译器,但其C语言编译器设计原理依然适用于现代编译器开发。开发过程,我们需要考虑如下关键点: 符号表管理:符号表记录了程序所有标识符的类型、作用域和关联地址,对于生成三地址代码至关重要,因为它提供了关于操作数的类型信息。 数据类型转换:编译器必须处理不同数据类型的运算,确保它们在三地址代码正确表示。例如,整型与浮点型之间的转换需要特别处理。

28,409

社区成员

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

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