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

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

GetDrive 方法

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

object.GetDrive ( drivespec ); 

參數(shù)

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

說(shuō)明

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

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

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

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

下面的例子說(shuō)明了 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]

下列示例說(shuō)明了 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

請(qǐng)參閱

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