Which is the best way to generate unique serial number? [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this questionI develop an application that needs to have a licence. It should be unique per machine. In the earlier versions I used Windows serial number for this purpose: i read it from Win, made some tricks/encryption on it to generete serial number & lic file. It was my own solution, in my new project I'd like to make a new one.
My question is: Is there a widely used way to generate unique serial numbers? Any, which is based on some hardware serial number, like motherboard or processor etc.?
(.Net4/C#/VS2010)
Thanks in advance!
GUID.
Guid g = Guid.NewGuid();
Console.WriteLine(g.ToString());
Look here to understand the options you have in Guid's ToString()
using guid?
GUIDs can be created in a number of ways, but usually they are a combination of a few unique settings based on specific point in time (e.g., an IP address, network MAC address, clock date/time, etc.).
精彩评论