HIDING CONTENTS OF TEXT FILES FROM PRYING EYES; USING APPLICATION.EXECUTABLEPATH
Posted on 2003-03-21
OK, here I am again. There are two questions in one, both interrelated.
1. I have a text file containing important information. I want the user to be able to read the content of this text file only through a textbox when the application is running. I have tried changing the file extensions from .txt to .bat or .dat, etc. Although it appears to work, the contents become easily readable when I changed the file extension to .doc, .txt, or .rtf. How can I make the text unreadable except through the application? Or, is it possible to compile the textfile with the application?
I have tried encryption, but I found the process rather cumbersome. I don't want to encrypt and decrypt ad infinitum. I don't want to use a database either; a textfile is just fine for my purpose.
2. I want to use the same text file to populate a textbox in a form. The text file is saved in the same directory as my project. Since I do not know where the users of my application will install it, I did not want to hardcode the path, so I used Application.ExecutablePath. The application gave an error: can't find the file. If I used "c:\\mytextfile.txt" it works fine
Thanks everyone, for your help.