Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Ask about getting Serial Number of Hard disk return two different values ?

$
0
0

Hi everyone,

I used below codes to get the serial number of hard drive.

ManagementObjectSearcher searcher = new
            ManagementObjectSearcher("select * from Win32_PhysicalMedia");

  foreach (ManagementObject obj in searcher.Get())
   {
       if (obj["SerialNumber"] != null)
       {
           strDiskSerial = obj["SerialNumber"].ToString();
           break;
       }
  }

But, when I try to get this serial of a computer that installed both Win 7 and Windows Server 2008. It returns two different values: "    9VM30Z8S" and "202020202020...5639334d5a305338";

I am needing to get an unique serial number (don't care to installed Operating System).

Are there anyone know this ?

Thanks and regards,

Tai


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>