CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 1999
    Posts
    8

    Exclamation Source Code for generating CD Key using C#

    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.

    Thanks in Advance
    Dayanand

  2. #2
    Join Date
    Jan 2002
    Location
    Scaro, UK
    Posts
    5,940

    Re: Source Code for generating CD Key using C#

    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.
    www.pinvoker.com - PInvoker - the .NET PInvoke Interface Exporter for C++ Dlls.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured