返回一个值,表示所指定驱动器的类型。
object.DriveType
其中 object 总是一个 Drive 对象。
说明
下面这段代码说明了 DriveType 属性的用法:
function ShowDriveType(drvpath){
var fso, d, s, t;
fso = new ActiveXObject("Scripting.FileSystemObject");
d = fso.GetDrive(drvpath);
switch (d.DriveType)
{
case 0: t = "Unknown"; break;
case 1: t = "Removable"; break;
case 2: t = "Fixed"; break;
case 3: t = "Network"; break;
case 4: t = "CD-ROM"; break;
case 5: t = "RAM Disk"; break;
}
s = "Drive " + d.DriveLetter + ": - " + t;
return(s);
}
请参阅
| | | | | | | | | |
应用于: