random serial no

Discussion in 'AutoCAD' started by amitvedak, Sep 25, 2004.

  1. amitvedak

    amitvedak Guest

    Hello,

    I am Looking for a function which can generate random no.
    whish i can use as serial no while installing my programs on other computers.
    can lisp do this?
    also looking for simple installing procedure of autocad programs.

    regards,
    Amit
     
    amitvedak, Sep 25, 2004
    #1
  2. amitvedak

    Kelie Guest

    not sure about using lisp.

    doslib offers a function (DOS_RANDOM) which generates a random integer.
     
    Kelie, Sep 25, 2004
    #2
  3. amitvedak

    rgood Guest

    Amit,
    if you get a random number that you use as a serial number, won't there be a possibility of having duplicate serial numbers somewhere down the road?

    Robert Good.
     
    rgood, Sep 25, 2004
    #3
  4. The best way to generate unduplicated random serial numbers (IMHO) is to use the ( getvar "date" ) function.

    Multiply the result by something like 1x10^6, then ( fix ) the product and extract the rightmost 14 characters or something along those lines.

    Using some form of the Julain date is the only way I could ever come up with to prevent duplicate numbers.
     
    Nick_Merchant, Sep 25, 2004
    #4
  5. amitvedak

    amitvedak Guest

    Thanks Nick,

    really a good methos of generating random no.
    this will definately help me.
    one more thinng,
    do u know any method of locking software with perticular computer by entering random code in regisrty?
    thanks again

    regards,
    Amit Vedak

     
    amitvedak, Sep 26, 2004
    #5
  6. amitvedak

    Dale Fugier Guest

    Also, DOS_GUID generates globally unique identifiers (GUID).
     
    Dale Fugier, Sep 27, 2004
    #6
  7. Well, that's another thing altogether.

    Personally, I create "mystery keys" in the registry with names that would not allow any user to make the connection that the key is related to my application.

    When the user enters the assigned serial number, first record it in the registry in any desired location. Then have your application translate it into ASCII code numbers or apply some random formula to it, then record that translated value in the "mystery key" location. That will prevent the user from searching for the translated version of the serial number, which is what the program can check for before it starts functioning.

    When the application is in use, it should first check the public version of the serial number, then translate the value and search the registry for the value in the "mystery key", if it exists. Pirates won't know what the name of it is and even if they did, they wouldn't know what value to enter in it.

    If the "mystery key" value equals the translated value of the serial number then let your program start running, otherwise "shut 'em down."
     
    Nick_Merchant, Sep 28, 2004
    #7
  8. examples to write to registry
    (vl-registry-write "HKEY_CURRENT_USER\\Test" "" "test")
    (vl-registry-write "HKEY_CURRENT_USER\\Test1\\Test2\\Test3" "" "test")
    examples to read registry
    (vl-registry-read "HKEY_CURRENT_USER\\Test")
    (vl-registry-read "HKEY_CURRENT_USER\\Test1\\Test2\\Test3")
     
    Alan Henderson @ A'cad Solutions, Sep 28, 2004
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.