Use the WMI managed objects in .Net. Here is a sample to get the volume
serial number for the 'C' drive:
System.Management.ObjectQuery q = new ObjectQuery("select * from
Win32_LogicalDisk where name = 'c:'");
ManagementObjectSearcher s = new ManagementObjectSearcher(q);
foreach (ManagementObject share in s.Get())
{
Console.WriteLine(share["VolumeSerialNumber"]);
}
Sujit D'Mello
"mi**@softwarecompany.com" wrote:
Does anyone know how to access the Volume Serial Number of a drive
using .NET? It is easily done in VB6 using the FilingSystemObject. I
appreciate any insight into the matter.