I_AM_DON_AND_YO U,
You could use the System.Security .Cryptography.C ryptoStream 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(fi le, ...)
Dim reader as New StreamReader(cr ypto, ...)
Dim writer as New StreamWriter(cr ypto, ...)
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_Y OU?" <us**@domain.co m> wrote in message
news:%2******** *******@TK2MSFT NGP12.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...