Serial Protection

Discussion in 'Programming General' started by Waffles, Dec 1, 2007.

Serial Protection
  1. Unread #1 - Dec 1, 2007 at 11:05 AM
  2. Waffles
    Referrals:
    4

    Waffles Guest

    Serial Protection

    I do not really know what to call this but its for like, if you made a program and you only want yourself or a certain someone to beable to open it and nobody else even if you send them it.

    You will need:
    1 Textbox
    1 Command Button
    -----------------------------
    (this is to get the serial)
    add this coding to Command1

    Code:
    Private Sub Command1_Click() Dim serial As String serial = VolumeSerialNumber("C:\") Text1.Text = serial End Sub

    then add this under FORM_LOAD of the program you want protected ::

    Code:
    Private Sub Form_Load() Dim serial As String serial = VolumeSerialNumber("C:\") If serial = "0000-0000" Then 'use the serial finder and then put the serial you get here or it will not open Form1.Show Else MsgBox "Sorry but you do not have permission to open this program" End End If End Sub
    Add this module to both the serial finder and prog you want protected

    Code:
    Public Declare Function GetVolumeSerialNumber Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long Public Function VolumeSerialNumber(ByVal RootPath As String) As String Dim VolLabel As String Dim VolSize As Long Dim serial As Long Dim MaxLen As Long Dim Flags As Long Dim Name As String Dim NameSize As Long Dim s As String If GetVolumeSerialNumber(RootPath, VolLabel, VolSize, serial, MaxLen, Flags, Name, NameSize) Then s = Format(Hex(serial), "00000000") VolumeSerialNumber = Left(s, 4) + "-" + Right(s, 4) Else VolumeSerialNumber = "0000-0000" End If End Function

    Now after you added the module to serial finder run it and push the command , now your serial should be in the text box, copy it and replace 0000-0000 in the form load and now it should work.
     
  3. Unread #2 - Dec 25, 2007 at 10:44 PM
  4. zaks
    Joined:
    May 5, 2007
    Posts:
    55
    Referrals:
    1
    Sythe Gold:
    0

    zaks Member

    Serial Protection

    Thx dude this will help with my bot im making
     
< MSDN installation help. | Paying alot for help | C++ | Delphi | <<<< >

Users viewing this thread
1 guest


 
 
Adblock breaks this site