Results 1 to 9 of 9

Thread: [RESOLVED] How can i make a serial code for my program

  1. #1

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Resolved [RESOLVED] How can i make a serial code for my program

    Ok i am having my app available for 30days free trial, but after that you have to purchase a serial, how can i make my app only recognise a specific type e.g NumberLetterLetterNumberLetterLetterNumberNumber-NumberLetter-Letter:NumberNumberNumberNumber?

    OR what would be the easiest way to have serials recognised?

  2. #2
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: How can i make a serial code for my program

    Hi,

    You can find some information about how to create a License for your Application, here.
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  3. #3

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Re: How can i make a serial code for my program

    that is like really advanced all i want is my program to be able to recognise the serial
    So how do i like check to see if the string(the serial) put in is in the format
    NumberLetterLetterNumberLetterLetterNumberNumber-NumberLetter-Letter:NumberNumberNumberNumber?

  4. #4
    Junior Member
    Join Date
    Jan 2010
    Posts
    20

    Re: How can i make a serial code for my program

    I dont know enough about regular expressions, but couldn't you check the string against stored pattern?

    If it matches the pattern then its a legitimate serial number?

  5. #5
    Frenzied Member Pc_Not_Mac's Avatar
    Join Date
    Oct 2009
    Location
    localhost
    Posts
    1,206

    Re: How can i make a serial code for my program

    It all dependence on how advance you want to make it.
    For example
    Were do you want to keep the keys
    local database or a online server.
    The list goes on and on.
    My Codebank:
    Windows Vista & 7 Glass Effect & Limit the amount of times your application could be opened.
    Pause Your Code & Check the OS name

    The question of whether computers can think is like the question of whether submarines can swim.

    Currently learning: Java

    Coding can be a learning experience or

  6. #6

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Re: How can i make a serial code for my program

    @PC NOT MAC
    I wasn't going to keep keys anywhere all i wanted to do was make like a string with different combination of things in it and the program recognises whether it is a valid serial (If it has the correct combination of things) then it accepts the serial, i know it wont be very secure but im going to make the serial very long.
    The program needs to recognise if the string has for example a NumberLetterLetterNumberLetterLetterNumberNumber-NumberLetter-Letter:NumberNumberNumberNumber
    So how would i do this?

    @SATORY
    How do i check it againsted a stored pattern???? ( This sounds like what i want to do )

  7. #7
    Lively Member
    Join Date
    Jul 2009
    Location
    Amsterdam, NY
    Posts
    85

    Re: How can i make a serial code for my program

    using regex, here is a sample project I put together. (this is comparing to the example you gave (for your serial number)

    vb.net Code:
    1. Imports System.Text.RegularExpressions
    2.  
    3. Public Class Form1
    4.  
    5.      Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    6.           Dim myreg As New Regex("^\d\w{2}\d\w{2}\d{2}-\d\w-\w:\d{4}\b")
    7.  
    8.           Dim str As String = "3su3wi28-2d-s:43782"
    9.           If myreg.ismatch(str) Then
    10.                Console.WriteLine(True)
    11.           Else
    12.                Console.WriteLine(False)
    13.           End If
    14.      End Sub
    15. End Class

    Code:
    Imports System.Text.RegularExpressions
    
    Public Class Form1
    
         Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
              Dim myreg As New Regex("^\d\w{2}\d\w{2}\d{2}-\d\w-\w:\d{4}\b")
    
              Dim str As String = "3su3wi28-2d-s:43782"
              If myreg.ismatch(str) Then
                   Console.WriteLine(True)
              Else
                   Console.WriteLine(False)
              End If
         End Sub
    End Class
    here are the two sites i used (first one on how to impliement into vb, 2nd one is how to make the regex (there is a nice table about 1/4th down the page)
    http://visualbasic.about.com/od/usin...RegExNET_2.htm
    http://www.codeproject.com/KB/dotnet/regextutorial.aspx
    CodeBank Posts: Base Converter

  8. #8

  9. #9
    Lively Member
    Join Date
    Jul 2009
    Location
    Amsterdam, NY
    Posts
    85

    Re: How can i make a serial code for my program

    good news, YOU can do REGEX!, the only problem is that the parentheses are "special" in regex, they are used for groups or something (no idea, this is my first day i've tried regex with any success, so im just as a beginner as you here.

    following works perfectly (just took out the parentheses and replaced the \w\w{5} with \w{6}

    Code:
    Dim myreg As New Regex("^\d\w{3}\d{2}\w\d{2}\w{2}\d{7}\w\d:-=\w{3}\d{3}:=:\w{2}\d\w\d\w{6}~\d{2}\w\d\w\d{2}$")
    
              Dim str As String = "1hgj75j34jh7685678k6:-=jhk657:=:ho5g6hhgjfk~56j5k67"
              If myreg.IsMatch(str) Then
                   MsgBox("I can do regex!")
              Else
                   MsgBox("I cant do regex :(")
              End If
    CodeBank Posts: Base Converter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width