Click here to Skip to main content
6,934,508 members and growing! (13,805 online)
Email Password   helpLost your password?
 
General Programming » DLLs & Assemblies » General     Beginner License: The Code Project Open License (CPOL)

Finger Print Class

By Johnny J.

Get a unique Finger Print / Machine ID which can be used for licensing purposes.
C#2.0, VB8.0, Windows, .NET2.0VS2005, Dev
Revision:2 (See All)
Posted:23 Apr 2007
Updated:8 Jul 2007
Views:44,155
Bookmarked:62 times
printPrint Friendly   add Share
      Discuss Discuss   Broken Article?Report  
16 votes for this article.
Popularity: 3.79 Rating: 3.15 out of 5
2 votes, 12.5%
1
2 votes, 12.5%
2
2 votes, 12.5%
3
2 votes, 12.5%
4
8 votes, 50.0%
5

Screenshot - FingerPrint.gif

Introduction

For my current project, I was looking for some way to generate a unique machine ID from the running computer's hardware so that I could use it for license purposes.

I looked everywhere, but I couldn't find any information as to how to do that. I did find a couple of third party controls that looked OK. One of them was TheScarms AppSentinel component (http://www.thescarms.com/AppSentinel/default.aspx), but unfortunately, that was written in VB6, and required distributing the VB6 runtime files. I didn't want to do that. The other was Ionworx' Machine ID component (http://www.ionworx.com/machineid.html). That looked OK, so I purchased the control. But, due to a lot of complications, I didn't get the license key from Ionworx until two weeks later.

Now, what does a person do in the meantime? I continued looking around the net, but with little luck. Until I happened to stumble over a page in another forum. A guy named Brian Hawley had done an absolutely brilliant piece of code. It was precisely what I was looking for - and simply too good to pass up.

I cannot take credit for the idea itself - all credit goes to Brian. But, I did convert the code from C#.NET to VB.NET (2005 - Framework 2.0), and I added some extra functionality. I hope Brian doesn't mind, because the code is simply too good not to share with others.

What the code does is that it gets the ID from the computer's CPU, BIOS, hard disk, motherboard, video card, and network adapter. It mixes it all together and generates an ID.

I added the possibility of selecting exactly what parts should be included in the test. You can use all, but I strongly recommend skipping the CPU ID, because it takes a really long time.

I also added the possibility of selecting the number of characters the result should consist of. More than 8 is really not necessary, because the number normally doesn't get any longer than that, but you might want to write your own routine to utilize the data and generate the machine ID from some other algorithm.

Background

If you're interested, the original C# code is here (6.64 KB), and a C# demo program can be found here (18.2 KB).

The direct translation to VB.NET done by me can be found here (13.7 KB). It is identical to the C# code above.

And of course, the enhanced code and VB demo programs can be downloaded from the links at the top.

Using the code

You simply need to instantiate the class and set the required properties. Then, you query the Value property - et voila!

Private fp As JCS.FingerPrint = New JCS.FingerPrint

fp.UseCpuID = False
fp.UseBiosID = True
fp.UseBaseID = True
fp.UseDiskID = True
fp.UseVideoID = True
fp.UseMacID = True

fp.ReturnLength = 8

MsgBox("Finger Print is: " & fp.Value)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Johnny J.


Member

Occupation: Software Developer (Senior)
Company: JC Software Solutions
Location: Sweden Sweden

Other popular DLLs & Assemblies articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 23 of 23 (Total in Forum: 23) (Refresh)FirstPrevNext
QuestionCould you explain the logic of this? PinmemberAsher Barak10:03 6 Nov '08  
GeneralProblem running as different users Pinmemberandrescasta11:26 22 May '08  
GeneralC# article Pinmemberc_srishti14:31 8 Apr '08  
GeneralRe: C# article PinmemberJohnny J.22:36 8 Apr '08  
Generalcann't download PinmemberEng_MR23:49 4 Jan '08  
GeneralRe: cann't download PinmemberJohnny J.0:06 5 Jan '08  
GeneralRe: cann't download [modified] PinmemberEng_MR1:25 5 Jan '08  
GeneralRe: cann't download PinmemberJohnny J.2:03 5 Jan '08  
GeneralHow can i make your demo work? PinmemberUmega22:32 13 Nov '07  
GeneralRe: How can i make your demo work? PinmemberJohnny J.22:54 13 Nov '07  
GeneralRe: How can i make your demo work? PinmemberUmega14:53 14 Nov '07  
GeneralThanks. Pinmemberbrian.hawley4:35 28 Jun '07  
GeneralRe: Thanks. PinmemberJohnny J.4:54 28 Jun '07  
GeneralRe: Thanks. Pinmemberbrian.hawley4:59 28 Jun '07  
GeneralVB6 Fingerprint PinmemberEdwardX25:50 16 Jun '07  
GeneralRe: VB6 Fingerprint PinmemberJohnny J.14:04 16 Jun '07  
GeneralRe: VB6 Fingerprint Pinmemberpikoon23:40 14 Mar '08  
GeneralRe: VB6 Fingerprint PinmemberEdwardX214:03 17 Jun '07  
GeneralRe: VB6 Fingerprint PinmemberJohnny J.22:39 26 Jun '07  
GeneralRe: VB6 Fingerprint PinmemberIonworx14:53 7 Jul '07  
GeneralRe: VB6 Fingerprint PinmemberJohnny J.22:03 8 Jul '07  
GeneralBad idea to base only on WMI PinmemberTonyTop11:32 20 May '07  
GeneralRe: Bad idea to base only on WMI Pinmemberbrian.hawley4:57 28 Jun '07  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+PgUp/PgDown to switch pages.

PermaLink | Privacy | Terms of Use
Last Updated: 8 Jul 2007
Editor: Smitha Vijayan
Copyright 2007 by Johnny J.
Everything else Copyright © CodeProject, 1999-2010
Web18 | Advertise on the Code Project