为何将一段静态脚本(调用ActiveX控件)改为动态后,页面提示错误:Automation 服务器不能创建对象?

zlgun 2002-01-16 10:10:48
test.htm 一切正常
<html>
<body>
<script language=JScript>
function CreateFile()
{
var fso, tf;
fso = new ActiveXObject("Scripting.FileSystemObject");
tf = fso.CreateTextFile("c:\\testfile.txt", true);
tf.Write ("This is a test.");
tf.Close();
}
CreateFile();
</script>
</body>
</html>

但转为test.asp后(如下)页面提示错误:Automation 服务器不能创建对象。
<%
str1="This is a test."
%>
<html>
<body>
<script language=JScript>
function CreateFile()
{
var fso, tf;
fso = new ActiveXObject("Scripting.FileSystemObject");
tf = fso.CreateTextFile("c:\\export.asi", true);
f.Write("<%=str1%>");
tf.Close();
}
CreateFile();
</script>
</BODY>
</HTML>

请问该如何解决?(不想在服务器端开放文件写权限,只好在客户端动手脚了)
...全文
391 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
miqier1209 2002-01-17
  • 打赏
  • 举报
回复
如何在服务器上使用Automation服务程序?

28,406

社区成员

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

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