Tag Archives: serial number

Get a hard drive serial number in C#

The example Get a disk volume serial number in C# shows how you can find the serial number for a disk volume such as C:\. If you reformat or repartition the drive, however, the volume serial number may change. This … Continue reading

Posted in system | Tagged , , , , , , , , , , , | Leave a comment

Get a disk volume serial number in C#

This example uses the GetVolumeInformation API function so get a disk volume’s serial number. It starts by using the System.Rumtime.InteropServices namespace and by declaring the API function. using System.Runtime.InteropServices; … [DllImport(“kernel32.dll”)] private static extern long GetVolumeInformation( string PathName, StringBuilder VolumeNameBuffer, … Continue reading

Posted in system | Tagged , , , , , , , , , , | 2 Comments

Get the system’s board serial numbers and CPU IDs in C#

This example shows how to get the system’s board serial numbers and CPU IDs. WMI (Windows Management Instrumentation) lets you use SQL-like statements to ask the computer about itself. The GetBoardSerialNumbers function shown in the following code returns a list … Continue reading

Posted in system, WMI | Tagged , , , , , , , , , , , , | 3 Comments