日期:2014-05-16  浏览次数:20368 次

Scripting.FileSystemObject 本地可用,服务器上不可用
D:\Inetpub\wwwroot\JSP\FileSys.html   运行正常
http://localhost/jsp/filesys.html     不能运行.
说是Automation服务器不能创建对像

这是怎么一个回事?
有没有人能给个方法.谢谢.

code   如下.
-----------------------
<html>

<head>
<title>   File   object   test </title>

</head>

<body     >
<script   language= "javascript "   >

var   fo   =new     ActiveXObject( "scripting.filesystemobject ");
var   f=fo.getfile( "c:\\a.txt ");
document.write   (f.Path.toUpperCase()     +   " <br> ");
document.write   ( "Create: "   +   f.DateCreated     +   " <br> ");
document.write   ( "Last   access   : "   +   f.DateLastAccessed     +   " <br> ");  

document.close();
 

</script>

</body>

</html>



------解决方案--------------------
客户端安全级别问题,工具——INTERNET选项——安全里设置
------解决方案--------------------
安全考虑,当然不能用了!
改用服务端FSO吧!
------解决方案--------------------
是安全问题,还是像楼上说的用FSO好了即便现在ok以后也可能存在隐患