protect .txt file eith pass

Hi can someone tell me how to protect a .txt file with a password.
For example the user tries to open test.txt and the C++ program(running all the time) gives you a pop up window where you have to enter the correct password.
Is there a way by which you are able to do that.

Thanks!
That's the wrong way to about it. In your scenario all I would have to do is kill or suspend your nanny process and I would be able to get into the text file. What you want to do is zip it and put a password on that.
If you don't want the user to have access to something, then don't store it on the user's hard drive.
Thanks but I want to do it so I can see how to do it

I will be very appreciative if you provide some code.

Thanks again!
It cannot be done. Go with Computergeek's suggestion and put it in a password-protected zip file.
Topic archived. No new replies allowed.