Click to See Complete Forum and Search --> : Source Code for generating CD Key using C#


dayananda
February 10th, 2005, 05:56 AM
Hi Guys,
I am a C-sharp developer, struggling to write the code or find the code for generating the CD-Key for one of my product development.

Requirements :
I want to generate a 16 digit number [XXXX-XXXX-XXXX-XXXX] for a given alpha numeric string. I am also looking for integration the "No. of concurrent users" in the key itself. Basically my application is a window based, I want to check for concurrent users, so to achieve this, I have to have this concurrent license number stored in the key. The moment I decrypt the key I should be able to get the string as well the concurrent number. This helps me in validating.

Appreciate if you can guys help me out in getting the right souce code or help me in writing it. I will be very happy if I get the source at the earliest. :thumb:

Thanks in Advance
Dayanand

darwen
February 10th, 2005, 09:56 AM
Have a look at the System.Security.Encryption namespace. Basically what you want is to have an encryption routine which will deliver you an 8-byte number (so when you turn it into ASCII hex providing you can have ABCDEF then you'll get 16-digits).

Then once you've found out how to do that you just need to pass in a buffer of the correct length with the data which you require.

Actually I'm rather interested how you propose to write this CD key to the CD. I've never really looked into it but I'd have thought you'd have problems with doing this in C++ never mind C#.

Darwen.