请问?

twenth 2003-10-11 05:27:50
下面的代码出现了错误,请问为什么??

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<%
TextStr=Request.Form("OutputText")
if (TextStr<>"") then
set FileObject=Server.CreateObject("Scripting.FileSystemObject")
TextFile=Server.MapPath("chattext.txt")
set Outstream=FileObject.OpenTextFile(TextFile,8) '没有权限,为什么?????
Outstream.WriteLine ( TextStr )

set Outstream=nothing
else
response.Write("不能发空信息")
end if
%>
<form name="form1" method="post" action="chatscreen.asp">
<p>
<input name="OutputText" type="text" id="OutputText" size="50">
</p>
<p>
<input type="submit" name="Submit" value="提交">
</p>
</form>
</body>
</html>




技术信息(用于支持人员)

错误类型:
Microsoft VBScript 运行时错误 (0x800A0046)
没有权限
/fancy/chatscreen.asp, 第 14 行


浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

网页:
POST 34 ??? /fancy/chatscreen.asp

POST Data:
OutputText=mao&Submit=%CC%E1%BD%BB

时间:
2003年10月11日, 17:20:41


详细信息:
Microsoft 支持
...全文
55 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
twenth 2003-10-11
  • 打赏
  • 举报
回复
我用了楼上的程序,但在我自己机上测试还是不能用。错误一样!!
不知为什么。
swlswl27 2003-10-11
  • 打赏
  • 举报
回复
你在是服务器上测试还是自己的机子测试的?如果是在服务器上测试,大多是不支持FSO功能!你可以到这个地址下载一下ASP探针测试一下:http://www.ajiang.net
angelheavens 2003-10-11
  • 打赏
  • 举报
回复
以下是我测试通过的,保存为test.asp,你试试

<%@ LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<%
TextStr=trim(Request.Form("OutputText"))
if TextStr<>"" then
set FileObject=Server.CreateObject("Scripting.FileSystemObject")
TextFile=Server.MapPath("chattext.txt")
set Outstream=FileObject.OpenTextFile(TextFile,8,true)
Outstream.WriteLine(TextStr)
set Outstream=nothing
set fileobject=nothing
else
response.Write("不能发空信息")
end if
%>
<form name="form1" method="post" action="">
<p>
<input name="OutputText" type="text" id="OutputText" size="50">
</p>
<p>
<input type="submit" name="Submit" value="提交">
</p>
</form>
</body>
</html>
twenth 2003-10-11
  • 打赏
  • 举报
回复
chattext.txt的属性没问题

fso权限怎么查???
angelheavens 2003-10-11
  • 打赏
  • 举报
回复
测试正常工作:

(1)看看chattext.txt的属性是否为只读;
(2)检查你是否有fso权限;

28,406

社区成员

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

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