Create Serial Number

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
'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.
 
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
 
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.
 
Back
Top