[vb.net] Elencare i drives disponibili e relative proprietà.
Imports System Imports System.IO Public Class Form1 Private Sub Bt1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bt1.Click Dim DInfo As DriveInfo Dim allDrives() As DriveInfo = DriveInfo.GetDrives() Dim s As String = Nothing Try For Each DInfo In allDrives If DInfo.IsReady = True Then s = "Tipo unita' :" & DInfo.DriveType.ToString s += " Nome unita' :" & DInfo.Name s += " Etichetta :" & DInfo.VolumeLabel s += " Spazio totale :" & DInfo.TotalSize s += " Spazio disponibile (bytes) :" & DInfo.TotalFreeSpace Debug.Print(s) End If Next Catch ex As Exception MessageBox.Show(ex.Message & Environment.NewLine & ex.StackTrace) End Try End Sub End Class