服务热线:13616026886

技术文档 欢迎使用技术文档,我们为你提供从新手到专业开发者的所有资源,你也可以通过它日益精进

位置:首页 > 技术文档 > JAVA > 新手入门 > 基础入门 > 查看文档

driveexists 方法

 

如果指定的驱动器存在则返回 true ;如果不存在则返回 false

object.driveexists(drivespec)

参数

object

必选项。 应为 filesystemobject 的名称。

drivespec

必选项。 驱动器号或完整的路径说明。

说明

对于可移动媒体的驱动器, 即使没有媒体 driveexists 方法也返回 true 。 可以使用 drive 对象的 isready 属性来决定驱动器是否就绪。

下面的例子说明了 driveexists 方法的用法。

function reportdrivestatus(drv){   var fso, s = "";   fso = new activexobject("scripting.filesystemobject");   if (fso.driveexists(drv))      s += "drive " + drv + " exists.";   else       s += "drive " + drv + " doesn't exist.";   return(s);}

请参阅

drive object | drives collection | fileexists 方法 | folderexists 方法 | getdrive 方法 | getdrivename 方法 | isready 属性应用于: filesystemobject 对象

扫描关注微信公众号