开发者

Which is the best way to generate unique serial number? [closed]

开发者 https://www.devze.com 2023-03-18 02:12 出处:网络
Closed. This question needs to be more开发者_运维知识库 focused. It is not currently accepting answers.
Closed. This question needs to be more开发者_运维知识库 focused. It is not currently accepting answers.

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 question

I 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.).

0

精彩评论

暂无评论...
验证码 换一张
取 消