Visual Basic Scripting Edition | 語言參考 |
GetDriveName 方法返回包含指定路徑中驅(qū)動器名的字符串。 object.GetDriveName(path)
參數(shù)object 必選項。應(yīng)為 FileSystemObject 的名稱。 path 必選項。指定路徑,要返回其組成部分的驅(qū)動器名。 說明如果無法確定驅(qū)動器,則 GetDriveName 方法返回零長度字符串 ("")。 下面例子舉例說明如何使用GetDriveName 方法: Function GetAName(DriveSpec)
Dim fso
Set fso =CreateObject("Scripting.FileSystemObject")
GetAName =fso.GetDriveName(Drivespec)
End Function
注意 GetDriveName 方法只能對提供 path 的字符串起作用。它不能試圖分析一個路徑,也不能檢查指定路徑是否存在。 請參閱GetAbsolutePathName 方法 | GetBaseName 方法 | GetDrive 方法 | GetExtensionName 方法 | GetFile 方法 | GetFileName 方法 | GetFolder 方法 | GetParentFolderName 方法 | GetSpecialFolder 方法 | GetTempName 方法 應(yīng)用于:FileSystemObject 對象
返回首頁 |