欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

腳本運(yùn)行時(shí)庫  

GetDrive 方法

返回相應(yīng)于指定路徑中驅(qū)動(dòng)器的 Drive 對象。

object.GetDrive ( drivespec ); 

參數(shù)

object
必選項(xiàng)。應(yīng)為 FileSystemObject 的名稱。
drivespec
必選項(xiàng)。drivespec 參數(shù)可以是驅(qū)動(dòng)器號 (c) 、帶冒號的驅(qū)動(dòng)器號 (c:) 、帶冒號和路徑分隔符的驅(qū)動(dòng)器號 (c:\) ,或者任意網(wǎng)絡(luò)共享的說明 (\\computer2\share1)。

說明

對于網(wǎng)絡(luò)共享,需要進(jìn)行檢查以確保共享存在。

如果 drivespec 和可接受的形式不一致或是不存在,那么將產(chǎn)生錯(cuò)誤。

要在普通的路徑字符串上調(diào)用 GetDrive 方法,可以使用以下序列來獲取適于作為 drivespec 的字符串。

[JScript]
DriveSpec = GetDriveName(GetAbsolutePathName(Path))
[JScript]

下面的例子說明了 GetDrive 方法的用法。

[JScript]
function ShowFreeSpace(drvPath)
{
   var fso, d, s ="";
   fso = new ActiveXObject("Scripting.FileSystemObject");
   d = fso.GetDrive(fso.GetDriveName(drvPath));
   s = "Drive " + drvPath.toUpperCase( ) + " - ";
   s += d.VolumeName + "<br>";
   s += "Free Space: " + d.FreeSpace/1024 + " Kbytes";
   return(s);
}
[VBScript]
DriveSpec = GetDriveName(GetAbsolutePathName(Path))

[VBScript]

下列示例說明了 GetDrive 方法的用法:

[VBScript]
Function ShowFreeSpace(drvPath)
   Dim fso, d, s
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set d = fso.GetDrive(fso.GetDriveName(drvPath))
   s = "Drive " & UCase(drvPath) & " - " 
   s = s & d.VolumeName   & "<BR>"
   s = s & "Free Space: " & FormatNumber(d.FreeSpace/1024, 0) 
   s = s & " Kbytes"
   ShowFreeSpace = s
End Function

請參閱

GetAbsolutePathName 方法 | GetBaseName 方法 | GetDriveName 方法 | GetExtensionName 方法 | GetFile 方法 | GetFileName 方法 | GetFileVersion 方法 | GetFolder 方法 | GetParentFolderName 方法 | GetSpecialFolder 方法 | GetTempName 方法
應(yīng)用于:FileSystemObject 對象