E
Evgeny Zoldin
Hi ALL,
how can I get serial number of harddrive using "pure" .NET, without Win API?
Thanx
how can I get serial number of harddrive using "pure" .NET, without Win API?
Thanx
using System.Management;Hi ALL,
how can I get serial number of harddrive using "pure" .NET, without Win API?
Thanx
Austin Ehlers said:using System.Management;Hi ALL,
how can I get serial number of harddrive using "pure" .NET, without Win API?
Thanx
//be sure to reference the System.Managment.dll
string GetSerialNumber(string drive)
{
ManagementObject disk=new
ManagementObject("win32_logicaldisk.deviceid=\"" + drive + ":\"");
return
disk.Properties["VolumeSerialNumber"].Value.ToString());
}
Michael Giagnocavo said:Also check out the other properties of some of the other WMI classes
(Win32_PhysicalMedia or Win32_DiskDrive), as you might find ID that isn't
related to the logical volume. Not all devices give an asset tag or Serial
number, but you can try. The volume serial is easily changed.
-mike
MVP
Austin Ehlers said:using System.Management;Hi ALL,
how can I get serial number of harddrive using "pure" .NET, without Win API?
Thanx
//be sure to reference the System.Managment.dll
string GetSerialNumber(string drive)
{
ManagementObject disk=new
ManagementObject("win32_logicaldisk.deviceid=\"" + drive + ":\"");
return
disk.Properties["VolumeSerialNumber"].Value.ToString());
}