为何将一段静态脚本(调用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>
请问该如何解决?(不想在服务器端开放文件写权限,只好在客户端动手脚了)