使用JavaScript / ActiveX来获取文件列表 [英] Use JavaScript/ActiveX to get list of files

查看:119
本文介绍了使用JavaScript / ActiveX来获取文件列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何使用Scripting.FileSystem对象?



在我目前的情况下,我想用一个特定位置的文件夹列表来填充一个SELECT元素。然后,选择一个文件夹后,我想显示该文件夹中找到的所有图像。



谢谢 b b

安全性不是问题。

解决方案

由于安全原因,您无法在网页中使用Scripting.FileSystem。
如果你有足够的权限来创建这样的对象(HTA或者没有IE安全性),可以像这样使用它:

  var obj = new ActiveXObject(Scripting.FileSystem); 


I've been Googling for hours with no avail...!

How do I use the Scripting.FileSystem object?

In my current case, I want to fill a SELECT element with a list of folders from a particular location. Then, after selecting a folder, I want to display all images found within that folder.

Thanks

P.S. Security is not an issue.

解决方案

You can not use Scripting.FileSystem in web pages because of security reasons. In case you have enough permissions to create such object (HTA or no IE security), it can be used like:

var obj = new ActiveXObject("Scripting.FileSystem");

这篇关于使用JavaScript / ActiveX来获取文件列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆