Possible Duplicate:
Where and how should I save license related information?
I create a license file for my application in order to distribute to users. But I have no idea where should I store the license file in a user computer.
Any suggestion?
thanks
If the licensing is per user, store it in the
%APPDATA%directory. If it is a per computer license, store it in the%PROGRAMDATA%directory or the program’s installation directory.%APPDATA%is a shell variable (you can view them by typingsetin a command window) that points the directory where the current user’s application data should be stored. It is often something likeC:\Users\MyUser\AppData\Roaming. When specifying a path for opening a file, it is possible to use the%APPDATA%variable directly, e.g.%APPDATA%\MyCompany\LicenseFile.dat. As @cdhowie points out in his comment, it is better to use the .NETEnvironment.GetFolderPath()function than using the environment variables.%PROGRAMDATA%works the same way, but maps to a directory that is common for all users on the system.