Tuesday 11 November 2014

Determine a Drive's Total Space in Visual Basic

Determine a Drive's Total Space in Visual Basic

To determine the total amount of disk space on a drive
Use the TotalSize property to determine the total amount of space on the drive, as illustrated in the following code:


    Dim cdrive As System.IO.DriveInfo
    cdrive = My.Computer.FileSystem.GetDriveInfo("D:\")
    MsgBox(cdrive.TotalSize)

No comments:

Post a Comment