急心请教:对象不支持此属性或方法: 'fso.OpentestFile'的原因?

jixiang0216 2007-04-23 11:39:33
classfile=server.mappath("../autojs/class"&RootID&".js")
Set fso = CreateObject("Scripting.FileSystemObject")
Set txt = fso.OpenTextFile(classfile,1)
classjs=txt.ReadLine
classjs=replace(classjs,"document.write('"," ")
classjs=replace(classjs,"')"," ")
txt.close


显示其中的第二行错误
错误的原因是:对象不支持此属性或方法: 'fso.OpentestFile'

搞了很久没搞出来,希望大家帮帮我~谢谢~累~

错误类型:
Microsoft VBScript 运行时错误 (0x800A003E)
输入超出了文件尾
/admin8/makeclass.asp, 第 142 行


浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.1.4322)

网页:
POST 51 ??? /admin8/makeclass.asp

POST Data:
MaxPerPage=16&Depth=0&demoid=10&Submit=%BF%AA%CA%BC

时间:
2007年4月23日, 上午 12:48:20


详细信息:
Microsoft 支持

贵求高手~事后可赠送商业版电子商务平台
...全文
724 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
CathySun118 2007-04-23
  • 打赏
  • 举报
回复
用这个试试
Set txt = fso.GetFile(classfile)
或者
Set txt = fso.OpenTextFile(classfile, ForWriting, True)
jacklinchen 2007-04-23
  • 打赏
  • 举报
回复
估计文件里是空的,没有内容。

IF txt.AtEndOfStream <> true then
classjs=txt.ReadLine
classjs=replace(classjs,"document.write('"," ")
classjs=replace(classjs,"')"," ")
end if
wangwm 2007-04-23
  • 打赏
  • 举报
回复
你要确保server.mappath("../autojs/class"&RootID&".js")文件中有内容
加个判断吧

IF txt.AtEndOfStream <> true then
classjs=txt.ReadLine
End if
qiubai1314 2007-04-23
  • 打赏
  • 举报
回复
Set fso = CreateObject("Scripting.FileSystemObject")
改为
set fso=server.CreateObject("scripting.filesystemobject")

28,391

社区成员

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

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