Create Serial Number

G

Guest

I have a windows app using vb.net 2005.

I would like to create a serial number based on a couple of characteristics
of the customers computer (computer name, HD number..etc). I don't need
anything complicated just a way to generate a 16 character number.

Is there an easy way to do this...?

Thanks
 
P

Paul Bromley

In my applicattion, I used an encrpted string based on a number of features
of the user machine and my program. I created an encryption program to
create the encrypted string, and within the user program is the same
encryption function to check that the two strings are equal. The function I
used is below:-

Imports System.Text
Imports System.Security.Cryptography
Module modEncrypt
Public Function HashData(ByVal s As String) As String
'Convert the string to a byte array
Dim bytDataToHash As Byte() = _
(New UnicodeEncoding()).GetBytes(s)
'Compute the MD5 hash algorithm
Dim bytHashValue As Byte() = _
New MD5CryptoServiceProvider().ComputeHash(bytDataToHash)
Return BitConverter.ToString(bytHashValue)
End Function
End Module

Best wishes

Paul Bromley
 
H

Herfried K. Wagner [MVP]

'bytDataToHash' denotes a 'variable' where a 'method' was expected

What error is this? how to correct the code in C#

You can correct it by posting your question to a C# newsgroup.
 
Joined
Sep 19, 2010
Messages
1
Reaction score
0
Easy Solution

I wrote a .NET library last week to handle this for you very quickly. It generates unique product codes for your application and validate them. You can get it extremely cheaply here: http://simpleserials.com
 
Joined
Nov 21, 2009
Messages
79
Reaction score
0
You can create a byte based hardware profile of the machine and take a hash of the bytes to get the "machine code". Then check that this hash is the same as the one generated everytime your app is run. If you want to use a ready scheme, take a look at CryptoLicensing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top