MatthewKing / DeviceId

A simple library providing functionality to generate a 'device ID' that can be used to uniquely identify a computer.
MIT License
722 stars 118 forks source link

Version compatible #50

Closed Luigi6821 closed 2 years ago

Luigi6821 commented 2 years ago

Hi, I am using version 5.2 for generating DeviceID as follows: string deviceId = new DeviceIdBuilder() .AddMachineName() .AddProcessorId() .AddMotherboardSerialNumber() .ToString();

I noted that on version 6.2 the "same" instructions generate a different result: string deviceId = new DeviceIdBuilder() .AddMachineName() .OnWindows(windows => windows.AddProcessorId().AddMotherboardSerialNumber()) .ToString();

Is possible to generated a device ID which is back-compatible with version 5.2?

Thanks in advance Luigi

MatthewKing commented 2 years ago

The default formatter changed between V5 and V6. Try adding .UseFormatter(DeviceIdFormatters.DefaultV5)

Luigi6821 commented 2 years ago

.UseFormatter(DeviceIdFormatters.DefaultV5)

Thank you Matthew it solved.

Regards Luigi