Dim c As New System.IO.DriveInfo("C") MsgBox(c.AvailableFreeSpace) '空き領域のうち、ユーザーが使用可能な領域 MsgBox(c.TotalFreeSpace) '空き領域の合計 MsgBox(c.TotalSize) 'ディスクの総容量
Dim total As Long total = Aggregate drv In My.Computer.FileSystem.Drives _ Where drv.DriveType = DriveType.Fixed _ Into Sum(drv.AvailableFreeSpace) MsgBox(total.ToString("#,0' Bytes'"))