JavaScript下利用fso判断文件是否存在的代码
时间:2024-05-02 17:25:30
function ReportFileStatus(filespec)
{
var fso, s = filespec;
fso = new ActiveXObject("Scripting.FileSystemObject");
if (fso.FileExists(filespec))
s += " exists.";
else
s += " doesn't exist.";
return(s);
}
采用客户端的 FileSystemObject 对象
例:
function check()
{
var fso;
fso = new ActiveXObject("Scripting.FileSystemObject");
if( fso.FileExists("c:\\testfile.txt"))
{
alert("Exists!");
}
else
{
alert("not Exists!");
}
}
标签:文件,是否存在
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python3自带工具2to3.py 转换 Python2.x 代码到Python3的操作
2021-11-13 16:52:41
![](https://img.aspxhome.com/file/2023/4/130834_0s.jpg)
对Python Pexpect 模块的使用说明详解
2022-10-24 02:14:09
PL/SQL Dev连接Oracle弹出空白提示框的解决方法分享
2024-01-28 03:19:05
![](https://img.aspxhome.com/file/2023/7/65257_0s.jpg)
python切换hosts文件代码示例
2023-07-19 15:41:43
实例讲解启动mysql server失败的解决方法
2008-12-26 17:27:00
BootStrap学习系列之Bootstrap Typeahead 组件实现百度下拉效果(续)
2024-04-10 11:02:48
![](https://img.aspxhome.com/file/2023/6/136806_0s.png)
基于python实现操作redis及消息队列
2021-08-06 22:31:29
Python基础之操作MySQL数据库
2024-01-23 01:50:14
![](https://img.aspxhome.com/file/2023/7/117317_0s.png)
详解四种Python中基本形态学滤波的实现
2023-05-09 15:10:09
![](https://img.aspxhome.com/file/2023/1/65531_0s.png)
Python保存数据至MySQL时中文问题
2011-02-23 12:06:00
python利用hook技术破解https的实例代码
2021-10-24 17:20:15
如何解决Oracle EBS R12 - 以Excel查看输出格式为“文本”的请求时乱码
2024-01-22 01:17:55
sql数据库修改sa密码操作教程
2024-01-15 13:41:23
Python matplotlib绘图建立画布及坐标系
2021-03-28 02:56:07
![](https://img.aspxhome.com/file/2023/6/76136_0s.png)
python基础编程小实例之计算圆的面积
2023-06-07 06:33:14
![](https://img.aspxhome.com/file/2023/4/99414_0s.png)
Python利用prettytable库输出好看的表格
2023-12-07 03:06:30
Python使用smtp和pop简单收发邮件完整实例
2022-01-07 05:48:40
设置python3为默认python的方法
2023-07-11 19:24:49
![](https://img.aspxhome.com/file/2023/4/110074_0s.png)
Python中Scrapy+adbapi提高数据库写入效率实现
2024-01-13 14:44:36
使用python采集Excel表中某一格数据
2021-11-06 21:02:26
![](https://img.aspxhome.com/file/2023/2/133322_0s.png)