CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: Machine id?

  1. #1
    Join Date
    Mar 2003
    Posts
    53

    Machine id?

    Hi,

    Is there something like a unique machine ID that I can retrieve so I can save a file and when opened, know if it was saved on the same machine?

    I don't want people using my saved files on any other machine apart from the one it was saved on originally.

    What is the best thing to grab which is unique to each machine?

    Thanks in advance
    Jim

  2. #2
    Join Date
    Mar 2002
    Location
    California
    Posts
    1,582
    I don't know the details, but there is a unique number associated with network cards. If you can't count on every machine having a network card, I know programs that will use hard drive IDs.

    Again, I don't know the details. This might be a better question in the VC++ forum since it's outside the scope of C++.

    Jeff

  3. #3
    Join Date
    Dec 2003
    Posts
    99
    Hi,
    IMO this depends on your OS. If your OS does write some machine id( if there exists one at all) then it is possible. Win and Linux both do not write any such information.
    If you afford to have your own file format then it is very well possible to do that.
    Ofcourse assuming that machine id exists.
    Global machine ids cannot.
    For a Lan or a limited number of machines it is very well possible to do that.
    One solution as suggested earlier is IP addresses.

    Regards

  4. #4
    Join Date
    Apr 2003
    Location
    Los Angeles area
    Posts
    776
    The MAC address of each network card is unique and is used often as a machine id. I'm sure there are different ways to get a MAC address. IP addresses often have multiple computers, i.e. computers behind routers, and so this is a poor machine id.

    Microsoft uses the MAC address and other component IDs to create a machineID. This is to protect that the operating system is not being copied to other machines, like harddrive cloning for a thousand duplicate PC's. The machine ID allows a number of components to change in the configuration before the OS stops working. If you are only dealing with XP/2000 machines then there might be an easy API call to get this ID.

  5. #5
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266
    Questions such as this are asked often because we don't want people to use our software without paying for it. That is usually called copy protection. Probably you are trying to do essentially the same thing. There are no easy answers. If you want to, you can try to find previous discussions; some of them are quite lengthy.
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

  6. #6
    Join Date
    Mar 2003
    Posts
    53
    Is there not a unique CPU serial number or somesuch?

  7. #7
    Join Date
    Jul 2001
    Location
    Pune-India
    Posts
    251
    Hi JIm1981
    There are so many threads available on Codeguru.
    Just spend some effort to search for those.

    There are 2 unique things.. either Windows Prod.Id or Processor ID.

    Read Windows Prod. ID from :
    "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr"


    Some of them are pasted below.(for Processor ID)

    http://www.codeguru.com/forum/showth...t=Processor+ID

    http://www.experts-exchange.com/Prog..._20803727.html

    http://www.codeguru.com/forum/showth...t=Processor+ID

    Hope so this helps u..
    Regards
    Nagesh

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