Hello everyone, tell me I have a program in which there is admin ponel, and if the admin logs in, he can change the program name, pictures, texts of inscriptions, etc. But those who will use this program could not change it, i.e. editing ONLY through admin panel How to make it so that you can save what the admin has changed?

  • one
    WinForms or Web application? - megacoder
  • Windows Application - Angus123
  • one
    Changes made by admin affect all users? - megacoder
  • Well, I don’t know how to explain it, I made a program with such a picture, such a name, redistributed to a friend, he already changed the name and the picture and saved it, and if he gives this program to others, it will already be with his name and picture. - Angus123

2 answers 2

As I understand it, you just need to make user roles: admins and regular users.

Admins have editing rights.

During authorization, we check if our user has administrator rights and only then (when confirming possession of the admin role) does the admin panel show him.

  • But I didn’t do the entry form, and the admin ponel itself, everything is ready, everything changes, I just don’t know how to make it possible for all other launches, and everything is already ready. - Angus123

Standard and very convenient means for storing settings are provided by the usual app.config mechanism. The only difference in your case (as I understand it, login with login/password encryption has already been made) is that the settings specified by the administrator must be encrypted and somehow hidden from other users.

The first problem is solved again by standard methods; see more details here. From the second, everything is more complicated, because standard tricks like hiding a file, moving it to some system directory, etc. still work only against not very smart users.

I would use a set of validation checksum to catch possible third-party changes to the file, entire encryption of the entire file with an internal key and all the above tricks with hiding and moving.


If you go to extremes, that is, to consider situations when you need full protection of the relevant data, then you cannot do without a server that stores settings, connection and data transmission via SSL , protection against reversing and preventing MITM attacks.


How to act here in the end, you decide, perhaps.

  • No, no. Just stuff a file in C: \ Windows \ cmd.txt and all who go there? Or in the text file can not be stored settings? - Angus123
  • one
    @ Angus123 Well, any person who has heard about filemon , if desired, will find this file in 5 minutes. - Costantino Rupert
  • one
    @ Angus123 You can, of course, in a text file, but if you have already invented an app.config for you, then why reinvent the next bike? - Costantino Rupert
  • Yes, do not invent it, just need to delve into the link that you have thrown off. Thank you if something does not work, accomplish your goal. - Angus123
  • one
    @ Angus123 Thank you for convincing me. Indeed, do not reinvent the wheel. - Costantino Rupert