开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜