Jobs
Author: Gehan Fernando Date Submitted: 11/3/2006 Category: Windows Operations Compatibility: .NET This code has been accessed 3522 times.
Email Yourself this snippet:
No declarations
Code
Me.Cursor = Cursors.WaitCursor Dim _DCount As Integer = 0 _DCount = My.Computer.FileSystem.Drives.Count Dim I As Integer = 0 Do While I < (_DCount) Application.DoEvents() ListBox1.Items.Add("Name" & vbTab & My.Computer.FileSystem.Drives(I).Name.ToString()) If My.Computer.FileSystem.Drives(I).IsReady = True Then ListBox1.Items.Add("Type" & vbTab & _ My.Computer.FileSystem.Drives(I).DriveType.ToString()) ListBox1.Items.Add("Format Type" & vbTab & _ My.Computer.FileSystem.Drives(I).DriveFormat.ToString()) ListBox1.Items.Add("Root Directory" & vbTab & _ My.Computer.FileSystem.Drives(I).RootDirectory.ToString()) ListBox1.Items.Add("Label" & vbTab & _ My.Computer.FileSystem.Drives(I).VolumeLabel.ToString()) ListBox1.Items.Add("Total Size" & vbTab & _ (((My.Computer.FileSystem.Drives(I).TotalSize / 1024) / 1024) / 1024).ToString("#,##0.00") & "GB") ListBox1.Items.Add("Available Free Space" & vbTab & _ (((My.Computer.FileSystem.Drives(I).AvailableFreeSpace / 1024) / 1024) / 1024).ToString("#,##0.00") & "GB") ListBox1.Items.Add("Total Free Space" & vbTab & _ (((My.Computer.FileSystem.Drives(I).TotalFreeSpace / 1024) / 1024) / 1024).ToString("#,##0.00") & "GB") Else ListBox1.Items.Add("Driver Not Ready To Display Informations") End If ListBox1.Items.Add("") I += 1 Loop Me.Cursor = Cursors.Default