Asp高手看过来

wl135 2000-09-05 05:33:00
我需要从一个文本文件中取出内容,显示在页面上,server是pws 4.0代码如下:

<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<%
path = server.MapPath("tz.txt")
set fs = server.CreateObject("Scripting.FileSystemObject")
if fs.FileExists(Path) then
set ts = fs.OpenTextFile(Path,ForReading,false)
tz=ts.readall
end if
set fs=nothing
%>
<%=path%>
<%=tz%>
</BODY>
</HTML>

tz.txt确实存在,且path返回也正确,但是访问页面时,报错:
Server object error 'ASP 0177 : 80070057'

Server.CreateObject Failed

/test/index1.asp, line 12

00000000

请各位大侠想想办法,在下感激不尽
...全文
93 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
cjlong 2000-09-05
  • 打赏
  • 举报
回复
因为ASP不能识别forreading常量。
改写为set ts = fs.opentextfile(path ,1,false)
ok了,就象用adovbs的标准常量须将interput\aspsamp\samples\ado
vbs.inc包含到asp页中
xtra 2000-09-05
  • 打赏
  • 举报
回复
set ts = fs.OpenTextFile(Path,ForReading,false)
改为:set ts = fs.OpenTextFile(Path) 测试通过

28,391

社区成员

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

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