Saving License Information

I have doubts about licensing. I am using a C # application. Scenario: The user receives a license for the application through mail as a file. He / she saves the license file on the desktop. Later, he / she selects a license and registers a click. Now the application is registered (licensed). After a few days, if the user deletes the license file from the desktop. The application will stop working because there is no file. I want to save license data somewhere in the registry or file (secret path). But what if this user account does not have sufficient permissions to read / write the registry or file. Is this a good way? Do you guys know any other method? I am new to this area. So please help me.

Thanks in advance.

+3
source share
4 answers

All application data must be stored in the% appdata% directory.

Since you specified C #, here is the code to get the folder:

Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

This will be displayed in the following location: In XP: C: / Documents and Settings / username / application data / In Vista: C: / Users / username / AppData / Roaming

I would recommend that you create a folder in this directory for your application and copy there.

+3
source

Microsoft has several suggestions for storage locations in Windows Vista: certificate of certification and application compatibility .

, [ ] DATA ( CODE), [] ProgramData. DATA, .

ProgramData\CompanyName. , . Windows, UAC.

+2

- - : " , ". , . , . . , , .

0

In this case, you should probably avoid writing to the registry, especially if the license can be deleted, added, or modified in the way you seem to describe. If licenses need to be replaced or changed in some way after installation, it may be better to write it to a file. Although I usually do not recommend writing any critical file or data like this to the computer. I would probably write it to a folder contained in the directory of the application itself. Include it in your application installation, if necessary.

0
source

Source: https://habr.com/ru/post/1710587/


All Articles