1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Protect program with Serial for Specific machine

Discussion in 'Visual Basic .NET' started by JesterJoker, Jun 23, 2010.

  1. JesterJoker

    JesterJoker Regular Member

    Joined:
    Jan 13, 2008
    Messages:
    237
    Likes Received:
    28
    I have a programmer working on code for me

    and I told him I wanted to lock down the program to be used on that machine only. Or to contact a webpage to validate the keycode / ip combo.

    I still want this built in, but trying to see what the best option is.

    I have 4-5 programs that I might have him make and just need advice on what to tell him to use for protection in it.

    Cant I just require them to give me a machine id? that the program will tell them when it opens.. and have it validate that and keycode when the program opens?

    or does that make a lot of unneeded code.
     
  2. kingofunivers

    kingofunivers Junior Member

    Joined:
    Apr 4, 2010
    Messages:
    129
    Likes Received:
    403
    Location:
    Italy
    That my method retrive information from the pc

    Code:
    Public Class Form4
        Dim a As String
        Public Function ReverseString(ByVal InputString As String) As String
            Dim lLen As Long, lCtr As Long
            Dim sChar As String
            Dim sAns As String
            lLen = Len(InputString)
            For lCtr = lLen To 1 Step -1
                sChar = Mid(InputString, lCtr, 1)
                sAns = sAns & sChar
            Next
            ReverseString = sAns
        End Function
        Public Function HEX2DEC(ByRef hex_str As String) As Long
            HEX2DEC = CLng("&H" & hex_str)
        End Function
        Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If My.Settings.fuckoff = 0 Then
                TextBox1.Text = Mid(My.Computer.Info.OSFullName, 1, 3) & Mid(My.Computer.Info.OSPlatform, 1, 3) & Mid(My.Computer.Info.OSVersion, 1, 3) & Mid(My.Computer.Info.InstalledUICulture.ToString, 1, 3) & Mid(System.Environment.UserName, 1, 3)
                TextBox1.Text = StrConv(TextBox1.Text, VbStrConv.Lowercase)
                TextBox1.Text = Replace(TextBox1.Text, "a", "7")
                TextBox1.Text = Replace(TextBox1.Text, "b", "1")
                TextBox1.Text = Replace(TextBox1.Text, "c", "3")
                TextBox1.Text = Replace(TextBox1.Text, "d", "6")
                TextBox1.Text = Replace(TextBox1.Text, "e", "8")
                TextBox1.Text = Replace(TextBox1.Text, "f", "5")
                TextBox1.Text = Replace(TextBox1.Text, "g", "9")
                TextBox1.Text = Replace(TextBox1.Text, "h", "2")
                TextBox1.Text = Replace(TextBox1.Text, "i", "4")
                TextBox1.Text = Replace(TextBox1.Text, "j", "0")
                TextBox1.Text = Replace(TextBox1.Text, "k", "A")
                TextBox1.Text = Replace(TextBox1.Text, "m", "B")
                TextBox1.Text = Replace(TextBox1.Text, "n", "C")
                TextBox1.Text = Replace(TextBox1.Text, "o", "D")
                TextBox1.Text = Replace(TextBox1.Text, "p", "E")
                TextBox1.Text = Replace(TextBox1.Text, "q", "F")
                TextBox1.Text = Replace(TextBox1.Text, "r", "A")
                TextBox1.Text = Replace(TextBox1.Text, "s", "B")
                TextBox1.Text = Replace(TextBox1.Text, "t", "C")
                TextBox1.Text = Replace(TextBox1.Text, "v", "D")
                TextBox1.Text = Replace(TextBox1.Text, "w", "E")
                TextBox1.Text = Replace(TextBox1.Text, "x", "F")
                TextBox1.Text = Replace(TextBox1.Text, "y", "1")
                TextBox1.Text = Replace(TextBox1.Text, "z", "2")
                TextBox1.Text = Replace(TextBox1.Text, ".", "3")
                TextBox1.Text = Replace(TextBox1.Text, "-", "4")
                TextBox1.Text = Replace(TextBox1.Text, ",", "5")
                TextBox1.Text = Replace(TextBox1.Text, "u", "6")
                'TextBox10.Text = HEX2DEC(TextBox1.Text)
                'TextBox10.Text = Mid(TextBox10.Text, 1, 15)
                'TextBox10.Text = ReverseString(TextBox10.Text)
            Else
                Form1.Enabled = True
                Me.Close()
            End If
        End Sub
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            a = HEX2DEC(TextBox1.Text)
            a = Mid(a, 1, 15)
            a = ReverseString(a)
            If TextBox10.Text = a Then
                Form1.Enabled = True
                Me.Close()
                My.Settings.fuckoff = 1
                My.Settings.Save()
            Else
                MsgBox("Serial Number Wrong!", MsgBoxStyle.Critical)
            End If
        End Sub
    End Class
    Page looks so :

    [​IMG]

    Just remove " ' " from this part
    'TextBox10.Text = HEX2DEC(TextBox1.Text)
    'TextBox10.Text = Mid(TextBox10.Text, 1, 15)
    'TextBox10.Text = ReverseString(TextBox10.Text)
    for get the serial number that changle from pc to pc. so buyer will give you the register code and you will give him the serial number
     
    Last edited: Jun 30, 2010
  3. johnronder

    johnronder Newbie

    Joined:
    Jun 30, 2010
    Messages:
    1
    Likes Received:
    1
    Look up HWID protection. Google is your friend
     
    • Thanks Thanks x 1
  4. jamesvick

    jamesvick Senior Member

    Joined:
    Jul 26, 2010
    Messages:
    968
    Likes Received:
    653
    Location:
    article directories
    Home Page:
    if you are using .net, try .net license protector. crack is available. it will obtain the machine id and lock the software to it.
     
  5. MyDymo

    MyDymo Junior Member

    Joined:
    Sep 15, 2009
    Messages:
    194
    Likes Received:
    56
    Occupation:
    Working
    Location:
    XYZ
    HWID Protection FTW
     
  6. hotcheats

    hotcheats Regular Member

    Joined:
    Dec 2, 2008
    Messages:
    328
    Likes Received:
    74
    Location:
    EU
    There are also paid ready-made and VERY powerful solutions, like XHEO (for .NET) and SerialShield.NET
     
  7. arbydee2

    arbydee2 Regular Member

    Joined:
    Mar 20, 2010
    Messages:
    413
    Likes Received:
    223
    Location:
    127.0.0.1
    Home Page:
    Activelock. The best freebie protection.