Any pc has factors that carry a specific serial range. Some quantities are assigned when the operating process is set up, but some are truly embedded in the components. Using C#, several embedded serials can be mixed to build a exclusive computer system ID.

Why a one of a kind serial? A basic motive is for branding application to a particular computer system. A possibly rigid licensing system, it can be really powerful dependent on how it is utilized.

For this report we will use two serials, the challenging push and the CPU. The two will be received with the crafted-in C# course Process.Administration.

If you produce a New Challenge in Visual Studio 2005 (any of the editions), you will detect the line “utilizing Technique.Administration” does not operate. You have to add it manually:

  • Go to the Remedy Explorer
  • Proper-click on on References and click on “Increase Reference…”
  • Discover Program.Administration from the .Internet tab.

When set up it is effortless to get the components ID’s.

The tough drive ID’s depends obviously on the harddrive. Below is the pseudocode:

  • Generate a ManagementObject with the string “gain32_logicaldisk.deviceid=[drive letter here]:”
  • Accessibility the serial with the index “VolumeSerialNumber”, for illustration disk[“VolumeSerialNumber”] in which disk is the ManagementObject

The CPU ID is in fact relatively flexible also. Numerous computer systems at present have a lot more than 1 CPU. You use the to start with one particular as in my instance, or several types:

  • Produce a ManagementObject with the string “earn32_processor”
  • Go by means of the accessible processors
  • Entry the house like so: managObject.Qualities[“processorID”]

Combining them can be very simple or elaborate. Basically incorporating them jointly in a row works just fine. For my instance some redundant 0’s are taken out prior to coming the ID’s of the initial obtainable travel and the 1st CPU.

Consider it out to see how the quantities glimpse.

Leave a Reply