CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 1999
    Location
    Israel
    Posts
    14

    Get Hardware\HDD unchanged ID

    Hye
    I am trying to create a protection for a program, wich suppose to prevet the user from installing it on more than one computer. How can I recognize a computer(its hardwares). I am looking for somthing like unchanged ID of a HDD, a Floppy Disk or other hardwares.

    Form Niztan Aviram.
    Any help whould be highly appreciated.

  2. #2
    Join Date
    Dec 1999
    Location
    Curitiba - Paraná - Brazil
    Posts
    6

    Re: Get Hardware\HDD unchanged ID

    You can use the FileSystemObjects to get the Serial Number of a HD.

    Put in references of your project the library:

    "Microsoft Scripting Runtime"

    and, try this code:


    Dim fs as new FileSystemObject, drv as Drive
    Dim lSerialNumber as Long

    'Here you can specfy the drive of windows
    set drv = fs.GetDrive("C:\")

    'get the serial number of specified drive
    lSerialNumber = drv.SerialNumber




    The variable lSerialNumber will contain the Serial Number of drive C:\ in decimal notation.

    Ok!


    Vanclei Matheus
    [email protected]
    Techno Dreamer

  3. #3
    Join Date
    Jan 2003
    Location
    Bulgaria
    Posts
    75

    to Vanclei Matheus

    And what if I format the volume? The number is changed and I must connect to the developer and say "My Windows crashed up and i format the drive. Please activate my program again!"?
    Last edited by Cimperiali; January 12th, 2003 at 04:52 AM.
    .:: ::.

  4. #4
    Join Date
    Jan 2003
    Location
    Bulgaria
    Posts
    75

    Try this

    Hi,

    you can try this. I didn't test it yet so use it on your won risk. It is working for me.
    Attached Files Attached Files
    .:: ::.

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

Featured