- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are commercial solutions for that sort of things, but you might try the program "getmac" (see https://helpdesk.latech.edu/index.php?option=com_content&task=view&id=207&Itemid=67). Of course, running an external program is not a very safe way to obtain this data, so perhaps this page is a better solution: http://stackoverflow.com/questions/13646621/how-to-get-mac-address-in-windows-with-c.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
arjenmarkus wrote:Thanks for the links, but as I've mentioned in my original post -- the MAC address is no good for my purposes (unique identifier of a PC) since it's very easy to change it.
There are commercial solutions for that sort of things, but you might try the program "getmac" (see https://helpdesk.latech.edu/index.php?option=com_content&task=view&id=20...). Of course, running an external program is not a very safe way to obtain this data, so perhaps this page is a better solution: http://stackoverflow.com/questions/13646621/how-to-get-mac-address-in-wi....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you considered using the VSN (volume serial number) of the system drive? It is a 32-bit unsigned number and can be retrieved by calling an API function. It can be changed by replacing the drive or reformatting the drive, but as far as I know the new value is assigned by algorithm rather than by the user. Some software for Windows is sold with a license scheme where the customer sends the VSN to the vendor after purchase and installation, and the vendor sends the customer a license file.
Of course, you have to consider how you will handle a customer who comes back to you for a new license after a hard drive failed or a bigger replacement drive was installed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah, missed that last bit.
You might use a combination of the MAC address and the hard disk's serial number, as mecej4 mentioned.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the goal of this restriction? Is this a commercial product that will be widely distributed and you're worried about piracy? Or is this something less formal and internal to your organization? Do you need to specify in advance which system it will run on? How do you plan to protect the code and data that enforces the restriction?
If you are serious about this, I would strongly recommend using a commercial license management package that supports the concept of "activation" and not try to roll your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve Lionel (Intel) wrote:Steve, it's not "serious" -- the "product" is a very specific one-task-aimed code and it must be provided to only one "customer" and only within a term based contract. So I need at least to do something to stop possible spreading of it and, formally, restrict its' usage after the contract is finished. And since I'm actually in a very close contact with future users of the application I can customize the code anyway necessary. For these reasons, I don't consider commercial protection systems. I do realize, that my "protection" will be easily broken if someone applies just a little effort to it, but on the other hand I feel need to at least try to do this one properly, without careless attitude. Best regards, Alexander.
What is the goal of this restriction? Is this a commercial product that will be widely distributed and you're worried about piracy? Or is this something less formal and internal to your organization? Do you need to specify in advance which system it will run on? How do you plan to protect the code and data that enforces the restriction?
If you are serious about this, I would strongly recommend using a commercial license management package that supports the concept of "activation" and not try to roll your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
mecej4 wrote:That seems to be a good idea. I will try that, thanks!
Have you considered using the VSN (volume serial number) of the system drive? It is a 32-bit unsigned number and can be retrieved by calling an API function. It can be changed by replacing the drive or reformatting the drive, but as far as I know the new value is assigned by algorithm rather than by the user. Some software for Windows is sold with a license scheme where the customer sends the VSN to the vendor after purchase and installation, and the vendor sends the customer a license file.
Of course, you have to consider how you will handle a customer who comes back to you for a new license after a hard drive failed or a bigger replacement drive was installed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The API function is documented at https://msdn.microsoft.com/en-us/library/windows/desktop/aa364993%28v=vs.85%29.aspx. Basically, what you have to do is to call the function as follows:
GetVolumeInformationA("C:\\",NULL,0,&VolSno,NULL,NULL,NULL,0);
Note that in a 32-bit program this function is _stdcall in linkage.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page