Sir,
I am developing an application in which i am to save some information in text file. During execution, I wish to read/write data from/to the file(.txt file). I dont want the file to be visible to user. Or if it is visible then it must be in programfile folder of the system and user could not delete the data of the file. What should i do? I tried to add the file in Resource file but could not read and write the file. PLease help me to read/write OR provide some other way to implement the same(described above).
Thanks in advance….
Don’t use
ProgramFiles(installation) folder:1. File will be visible for user
2. If user won’t have admin rights your app will fail on modifying the file.
Windows System folderis also question of rights. I’d advice to use system registry or appdata folder: you can get itEnvironment.GetFolderPath(Environment.SpecialFolder.ApplicationData). You’ll be able to write to that location without admin rights. You should create some special subfolder there (not needed, but would be convinient).Or in registry case:
writing to registry:
reading from registry:
Your_Cpecial_Key here is some identifier (like in hashtable) that allows you to get access to your data.