I_AM_DON_AND_YOU,
You could use the System.Security.Cryptography.CryptoStream to read & write
an encrypted stream. This encrypted stream could be a regular text file.
The user could still open the file in Notepad, however all they will see is
random letters & numbers in a binary format.
Basically you create the CryptoStream over your FileStream. You then open
your StreamReader & StreamWriter over your CryptoStream.
Dim file As New FileStream(...)
Dim crypto As New CryptoStream(file, ...)
Dim reader as New StreamReader(crypto, ...)
Dim writer as New StreamWriter(crypto, ...)
http://msdn.microsoft.com/library/de...yptingdata.asp
Just be certain to use a consistent & secure Key & IV so that you are able
to decrypt the data later.
I don't have samples handy, there is a way you could use a user supplied
password as part of the Key & IV.
Hope this helps
Jay
"I_AM_DON_AND_YOU?" <us**@domain.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
In my program I am using the notepad file to read/write data. I don't want
that someone should be able to delete/change the contents of that file by
opening that file in Notepad or other editor. Like there is a feature in
Word to put password to open your document. I want to do something like
that in Notepad file because I can't store the data in word file (in
binary format) because I am using stream reader/write object.
Is there any way that I read/write from my vb.net program in a text file
and still able to protect that file from end users to change its contents...