I’m developing a client/server application which needs to assign a unique identifier to every registered client based on hard disk serial number and physical adapter MAC address… but I prefer not to use ManagementObjectSearcher or any WMI solution as they are quite slow. How can I obtain those values using native methods?
I’m developing a client/server application which needs to assign a unique identifier to every
Share
If you want to get a unique identifier out of hardware values, you have to keep in mind that is really important to apply always the same method for every registered client. What I mean is that if a machine have multiple HDD, and it’s quite common, you will always have to take the serial out of the first one or the last one, for everyone.
Unless you are doing this only for licensing purposes, you also have to implement a tolerance algorithm capable of understanding if a user changed one or more components of his computer.
I’ll show you the code I normally use to create unique identifiers out of hardware values… it’s maybe a little bit outdated expecially for what concerns 64x support (registry keys and pointers, especially) but it’s just to give you an idea. The fingerprint is created out of the first HDD serial, the first adapter MAC address and SMBIOS data using only native methods.
You just have to call HardwareAnalyzer.CreateFingerprint() to obtain what you need.