Drive Information in VB.NET

  • Thread starter Thread starter NWhite
  • Start date Start date
N

NWhite

Is that a VB.NET class that will give drive inforation or
the VB6 FileSystemObject the only way to get drive
information?

I have looked in the System.IO Namespace but I don't seem
to find anything that will give drive information such as
TotalSize etc.

TIA
NWhite
 
Hello,

NWhite said:
Is that a VB.NET class that will give drive inforation or
the VB6 FileSystemObject the only way to get drive
information?

I have looked in the System.IO Namespace but I don't seem
to find anything that will give drive information such as
TotalSize etc.

Add a reference to "System.Management.dll".

\\\
Dim disk As New ManagementObject( _
"Win32_LogicalDisk.DeviceID=""C:""" _
)
Dim diskProperty As PropertyData
For Each diskProperty In disk.Properties
Console.WriteLine( _
"{0} = {1}", _
diskProperty.Name,
diskProperty.Value _
)
Next diskProperty
///
 
Back
Top