Re: Computer Name - Best way to obtain this VB.Net
- From: "Paul Bromley" <flyfisher@xxxxxxxxxxxxx>
- Date: Tue, 12 Dec 2006 13:58:48 -0000
Thanks for all of the feedback on this and my recent posts. I have decided
to go with computer name and to use this along with other strings in an
encrypted format to produce my registartion keys. This will be more than
adequate for my purposes, as I do not want to make life difficult ofr my
users, but just want to preevent them from making multpile unpaid installs
on the same network.
Best wishes,
Paul Bromley
"Pritcham" <dontwanttogivemyname@xxxxxxxxxxx> wrote in message
news:1165841082.577163.65320@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Paul
You could also use the MAC address as this is specific to the NIC card
(as far as I understand) and has to be unique on the same network.
As a failsafe to the code that's posted here for getting the serial
number of the harddrive, you could use a combination of the MAC address
and the harddrive serial - that way, if the drive doesn't have a serial
then you can use the MAC address.
There's plenty of code available for getting the MAC address should you
need it.
Martin
Paul Bromley wrote:
Many thanks for this Shane - I will take a look tomorrow. Has this worked
OK
on Win2K as well as XP?
Best wishes
Paul Bromley
"ShaneO" <spcacc@xxxxxxxxxxxxxxx> wrote in message
news:457c99ff$0$16557$afc38c87@xxxxxxxxxxxxxxxxxxxxxxx
Paul Bromley wrote:
I assume that this is likely to be the best way? :-
mComputerNetBiosName = System.Environment.MachineName
Yes, you're correct with this.
I've followed your other posts and would like to suggest that
generating a
unique Serial Number for your software, on each machine that it is
executed, is not that difficult.
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.SystemDirectory, 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 -
www.arnfieldcomputerservices.com/apps/spi/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.
ShaneO
There are 10 kinds of people - Those who understand Binary and those
who
don't.
.
- References:
- Computer Name - Best way to obtain this VB.Net
- From: Paul Bromley
- Re: Computer Name - Best way to obtain this VB.Net
- From: Paul Bromley
- Re: Computer Name - Best way to obtain this VB.Net
- From: ShaneO
- Re: Computer Name - Best way to obtain this VB.Net
- From: Paul Bromley
- Re: Computer Name - Best way to obtain this VB.Net
- From: Pritcham
- Computer Name - Best way to obtain this VB.Net
- Prev by Date: Re: Measre Distance using the PostCode
- Next by Date: dim x as something
- Previous by thread: Re: Computer Name - Best way to obtain this VB.Net
- Next by thread: DataGridView visible columns
- Index(es):
Relevant Pages
|