Hey Guys, Gals.
The following function I am quite stuck on... and hope you are able to help or provide some form of direction.
Basically I have been able to gather "logical drive details" about connected storage, however, with regards to the Serial Number, all I can acquire is the Volume Number, which is not unique to the physical hard drive itself.
I realise that in order to acquire the manufactures serial number I need to utilise the Win32_PhysicalMedia Class, (link below), however I haven't got the foggiest in where to start etc.
Does anyone have any ideas, code example that actually works?
I am using Vista or XP Professional, Visual Studio 2008.
As example code I have
ManagementObjectSearcher Serial = new ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMedia")
foreach (ManagementObject Serials in Serial.Get()
{ combo_box.Items.Add(Serials["SerialNumber"].ToString()); }
Furthermore, the error I get is: NullReferenceException was unhandled, object reference not set to an instance of an object? Use the "new keywords" to create an object instance?
Cheers
Ian.