473,387 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to generate product key?

Hi,

I would like to have my users register their name and organization name and
submit them through email so that we can generate a product key for them.
But we have no idea how to generate a product key something look like
Microsoft's product key. In addition, I would like to have the key generated
based on their name and company name.

Any idea on how to go about doing this using VB.NET? Thanks in advance.

Regards,
Antonio

Feb 4 '07 #1
6 15412
Why not use an encryption algorithm such as Blowfish (.NET version avail
here: http://www.hotpixel.net/software.html). Encrypt the Organization Name
using the User Name as the password. Take the encrypted output and format it
how you wish (divide it into 5-character segments, delimited with dashes,
chopping it down to the length you want).
"Antonio" <an*******@hotmail.comwrote in message
news:7F**********************************@microsof t.com...
Hi,

I would like to have my users register their name and organization name
and submit them through email so that we can generate a product key for
them. But we have no idea how to generate a product key something look
like Microsoft's product key. In addition, I would like to have the key
generated based on their name and company name.

Any idea on how to go about doing this using VB.NET? Thanks in advance.

Regards,
Antonio

Feb 4 '07 #2
Almost weekly the same question is asked in this newsgroup & you'll get
pointed to the same few controls like the ASPOSE one by the MVP's

Doesn't anyone write there own one of do like the MVP's & search Google for
the answer?

--
Newbie Coder
(It's just a name)
Feb 5 '07 #3
"Newbie Coder" <ne*********@spammeplease.comwrote in
news:#l**************@TK2MSFTNGP05.phx.gbl:
Doesn't anyone write there own one of do like the MVP's & search
Google for the answer?
Writing a licensing control is a lot of work - especailly to make it
bulletproof and reliable...
Feb 5 '07 #4
Newbie Coder wrote:
Almost weekly the same question is asked in this newsgroup & you'll get
pointed to the same few controls like the ASPOSE one by the MVP's

Doesn't anyone write there own one of do like the MVP's & search Google for
the answer?
There are problems with simply supplying code samples for what the OP is
seeking -

1. To provide the functionality required needs much more than a code
snippet, it usually requires an entire application to show how you might
do it.

2. Showing someone's solution may pose a risk of exposing
Code/Algorithms that people have spent a long time perfecting and don't
want to become public knowledge. (For obvious reasons).
Nonetheless, I HAVE provided details in earlier posts, and do so again
now, in hope that the OP will obtain some inspiration to develop his/her
own -

(Sample of my Code that uses the Serial Number of the HDD as part of the
Application Serial Number)

*******
I use the following code (watch for wrapping!) -

Imports System.Management

''' <summary>
''' String of 1 to 2 chars. eg. "C" or "C:".
''' </summary>
''' <param name="sDriveLetter"></param>
''' <returns></returns>
''' <remarks></remarks>
Public Function GetDriveSerialNumber(ByVal sDriveLetter As String) As String

If Len(sDriveLetter) = 1 Then
sDriveLetter &= ":"
Else
sDriveLetter = Strings.Left(Environment.SystemDirectory, 2)
End If

Dim HardDiskInfo As New ManagementObject("Win32_LogicalDisk.DeviceID="
& ChrW(34) & sDriveLetter & ChrW(34))
Dim HardDiskProperty As PropertyData =
HardDiskInfo.Properties("VolumeSerialNumber")
Return HardDiskProperty.Value.ToString

End Function

I first obtain the Drive Serial Number and then ensure it is
8-Characters in length -

Dim sA As String =
GetDriveSerialNumber(Strings.Left(Environment.Syst emDirectory, 2))

Dim N As UInt16 = Len(sA)
If N < 8 Then
sA = sA.PadRight(8 - N, "0")
ElseIf N 8 Then
sA = Strings.Left(sA, 8) 'Truncate to 8 Chars.
End If

After this I "AND" the value with another routine that automatically
generates an 8-Character HEX number based on the title of my software.
I then end up with a 16-Character HEX number, which is unique to each of
my applications and unique on every computer, I then do some more
XOR'ing and present this to the User as the Application Serial Number.

I obviously have another application that reverses all of this to
provide an Unlock Code that the User enters.

There are literally hundreds of Users running my applications using this
method, and although it really only stops the honest pirates, it serves
my purposes well.

If you'd like to see an example, please download one of my apps (written
for specific clients) from the following site -

http://www.arnfieldcomputerservices....di/publish.htm

This will provide an example of what my Registration Screen looks like.

If you require any further assistance, please feel free to contact me
direct via the email address used in this post.

*******
FootNote: When this code sample was last posted, I received warnings
from others that not all systems have drives with Serial Numbers. I
don't dispute this (although I've NEVER seen it) so you might want to
consider an additional or an alternative means of obtaining a unique
number from the system. (ie. MAC Address etc.)
ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Feb 5 '07 #5
Shane

In my opinion very correct especially about this one
2. Showing someone's solution may pose a risk of exposing Code/Algorithms
that people have spent a long time perfecting and don't want to become
public knowledge. (For obvious reasons).
Cor
Feb 5 '07 #6
Whatever protection you use it will always be cracked

--
Newbie Coder
(It's just a name)
Feb 5 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tools | last post by:
WinTranslator & MacTranslator Demo Editions Generate Design Diagrams from Your Source Code in Minutes Placitas, NM ? April 5, 2004 - Excel Software is pleased to announce the immediate...
6
by: Sebastien | last post by:
Hi, I am building a products database, linking sales and production. Each part has a unique sales Stock Code and Production Number. The sales stock code is a combination of letters and numbers...
12
by: anna | last post by:
Map, generate, and maintain 50% of your .NET application code, namely your business and data objects. Use these objects in ASP.NET, Windows Forms, console or services applications. Business and...
4
by: cardinallijr | last post by:
Hi all, sorry about the simple question but I'm new to XSL. I have a XML with 5 elements, for example: <root> <products> <product> <id>1</id> </product> <product>
1
by: urban.john | last post by:
Here are my steps: create resource files from resx files: <echo message="CREATING RESOURCE FILES FROM RESGEN EN" /> <resgen todir="product\resources_en" verbose="true"> <resources> <include...
9
by: Paul | last post by:
Hi, I have spent the last couple of days researching this issue. And I have also spent time thinking about what is needed. I am distributing my software as shareware. When a customer orders a...
20
by: jjmillertime | last post by:
I'm new so i apologize if this is in the wrong spot. I'm also new to programming in C and i've been searching for quite a while on how to create a program using C that will generate two random...
5
by: grasshopper2 | last post by:
I am looking to build a regular expression that will match pTOC(somenumber) where the number varies between 1& ten, this is to generate a table of contents file that I desperately need to display...
1
by: divyac | last post by:
I am doing an inventory project using PHP in which there is a text box.The customer id should be entered in that text box.If that customer id is valid,another text box should be generated in which...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.