Hide a .txt file.
- I have a Windows app, which reads and writes to a flat file (.txt file). I don't want user to modify this file. What are my options? Thanks.
Respuestas
- The simplest thing is to make the file read only. Hiding it will only protect you from the mildly curious. I have my systems set to show hidden files...that is not at all uncommon.
- Marcado como respuestaJeff ShanMSFT, Moderadormartes, 10 de noviembre de 2009 8:18
- how are you going to write to this file if you don't want it modified?
you can set the File Attributes to ReadOnly, but...
I guess you could check if the User is you, and if so set it to read/write. If not you set it to ReadOnly. Don't know if that would work, but worth a try
see this link for setting the Attributes
http://www.dreamincode.net/forums/showtopic31134.htm- Marcado como respuestaJeff ShanMSFT, Moderadormartes, 10 de noviembre de 2009 8:17
- Propuesto como respuestaShariqDON miércoles, 04 de noviembre de 2009 21:37
I have a Windows app, which reads and writes to a flat file (.txt file). I don't want user to modify this file. What are my options? Thanks.
You should consider different method to protect file from tampering, Readonly and Hidden will not work because user can remove readonly attribute from file through properties. You can use resgistry or encrypt/encode the text before save to file. Also, you can put the text file in IsolatedStorage
kaymaf
If that what you want, take it. If not, ignored it and no complain- Marcado como respuestaJeff ShanMSFT, Moderadormartes, 10 de noviembre de 2009 8:17
Todas las respuestas
- i have a Idea Or suggession....
You can Also Encrypt it...... With Text Replacement Method....
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/1e0c977f-d023-4e8f-b551-24e15108b4ab
www.shariqdon.media.officelive.com - The simplest thing is to make the file read only. Hiding it will only protect you from the mildly curious. I have my systems set to show hidden files...that is not at all uncommon.
- Marcado como respuestaJeff ShanMSFT, Moderadormartes, 10 de noviembre de 2009 8:18
- how are you going to write to this file if you don't want it modified?
you can set the File Attributes to ReadOnly, but...
I guess you could check if the User is you, and if so set it to read/write. If not you set it to ReadOnly. Don't know if that would work, but worth a try
see this link for setting the Attributes
http://www.dreamincode.net/forums/showtopic31134.htm- Marcado como respuestaJeff ShanMSFT, Moderadormartes, 10 de noviembre de 2009 8:17
- Propuesto como respuestaShariqDON miércoles, 04 de noviembre de 2009 21:37
- By Using VB.Net you can use following ways to secure your file to an extend. Either you can mark your file as ReadOnly, Hidden or as a System File.
Dim attribute As System.IO.FileAttributes = IO.FileAttributes.Encrypted System.IO.File.SetAttributes("file1.txt", attribute) Dim attribute As System.IO.FileAttributes = IO.FileAttributes.Hidden System.IO.File.SetAttributes("file1.txt", attribute) Dim attribute As System.IO.FileAttributes = IO.FileAttributes.System System.IO.File.SetAttributes("file1.txt", attribute)
Balaji Baskar [Please mark the post as answer if it answers your question] I have a Windows app, which reads and writes to a flat file (.txt file). I don't want user to modify this file. What are my options? Thanks.
You should consider different method to protect file from tampering, Readonly and Hidden will not work because user can remove readonly attribute from file through properties. You can use resgistry or encrypt/encode the text before save to file. Also, you can put the text file in IsolatedStorage
kaymaf
If that what you want, take it. If not, ignored it and no complain- Marcado como respuestaJeff ShanMSFT, Moderadormartes, 10 de noviembre de 2009 8:17
- Hide it in an image using steganography.

