سایز درایو
For Each curDrive As IO.DriveInfo In My.Computer.FileSystem.Drives
If curDrive.DriveType = IO.DriveType.Fixed Then
If curDrive.Name = "c:\".ToUpper Then
Dim theFreeSpace = (curDrive.AvailableFreeSpace / (1024 * 1024 * 1024)).ToString.Trim & " GB"
MessageBox.Show(theFreeSpace.ToString())
Exit For
End If
End If
Next
سایز فایل
Dim filename As String = "c:\autoexec.bat"
Dim fFile As New System.IO.FileInfo(filename)
Dim fSize = (fFile.Length / (1024 * 1024)).ToString.Trim & " MB"
MessageBox.Show(fSize.ToString)