Hello,
I have created a .ini file but want to lock this file so that the user cannot change it manually.
give me your suggestions or let me know what other solutions to lock the .ini file
Thanks
Hello,
I have created a .ini file but want to lock this file so that the user cannot change it manually.
give me your suggestions or let me know what other solutions to lock the .ini file
Thanks
My suggestions are to:
1 - Zip the file with encryption. Read the encrypted file into memory, decrypt it, and then read from the decrypted string; reverse the operations to write it - or -
2 - Leave the file itself unencrypted, but encrypt the strings in it.
Option 1 will involve writing your own QSettings format. Years ago I posted code here for an implementation of QSettings which used XML instead of INI format. You might be able to adapt that for reading settings from an in-memory string.
Option 2 probably will require you to convert the INI string into a QByteArray, encrypt that into another QByteArray, and then use the standard QSettings class to write that out. The user will see the strings in the INI file, but if you encrypt both keys and values, they will be nonsense and not retrievable.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Bookmarks