[vb.net] benutzer Speicher, freier Speicher und gesamter Speicher einer Festplatte

Gepostet am: Mar 25, 2011 3:6:58 PM

Festplatte

Dim strDrive As String = "C:"Dim lw As New System.IO.DriveInfo(strDrive)Dim TotalFreeSpace As Long = lw.TotalFreeSpace Dim TotalSize As Long = lw.TotalSize Dim DriveSpaceUsed As Long = TotalSize - TotalFreeSpace MsgBox(TotalFreeSpace.ToString & vbNewLine & TotalSize.ToString & vbNewLine & DriveSpaceUsed.ToString)