您的位置:首页 > 移动开发 > Objective-C

FileSystemObject_Driver

2010-12-04 11:12 375 查看
How to get the related drive's info? Please see following:

Option Explicit
Dim objFso, objDrive
Dim strDrive
Dim strDriveInfo
strDrive = "c:"
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objDrive = objFso.GetDrive(strDrive)
'properties
'1: TotalSize --- the drive's totalsize and the unit is byte
'2: AvailableSpace
'3: FreeSpace --- the drive's freespace and the unit is byte
'4: DriveLetter --- the drive's letter eg: c, d, e
'5: DriveType --the drive's type eg: movable, stable, network, CD-ROM and RAM
'6: SerialNumber
'7: FileSystem--the filesystem's type eg: FAT,FAT32,NTFS etc.
'8: IsReady ---Can the drive be used?
'9: ShareName
'10: VolumeName
'11: Path--- the drive's path
'12: BootFolder
strDriveInfo = " TotalSize is: " & objDrive.TotalSize & Chr(13) & _
" AvailableSpace is: " & objDrive.AvailableSpace & Chr(13) & _
" FreeSpace is: " & objDrive.FreeSpace & Chr(13) & _
" DriveLetter is: " & objDrive.DriveLetter & Chr(13) & _
" DriveType is: " & objDrive.DriveType & Chr(13) & _
" SerialNumber is: " & objDrive.SerialNumber & Chr(13) & _
" FileSystem is: " & objDrive.FileSystem & Chr(13) & _
" IsReady is: " & objDrive.IsReady & Chr(13) & _
" ShareName is: " & objDrive.ShareName & Chr(13) & _
" VolumeName is :" & objDrive.VolumeName & Chr(13) & _
" Path is: " & objDrive.Path & Chr(13) & _
" RootFolder:" & objDrive.RootFolder

MsgBox strDriveInfo
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: