If you encrypt a file content once, the contents of the file will not be updated, most of the serialized anti-sequence encryption program on the Internet is no problem.
1: Because the log file will update the content at any time, the online program is not feasible. Need to make changes
If you want to open txt, the using (var file =new FileStream (path,filemode.append)) simply expands the Append command, and the result is that the new additions will not be displayed.
or two different periods written in the middle of the content of the log is random, because the file mode is append, the extension of the new line, this command is two paragraphs of text with a line break, the specific addition of the symbol did not go to test.
Use this using (var file =new FileStream (path,filemode.openorcreate)) to open or generate the pattern.
2: The program to use the list content to add to the document, each time the data is stored, the contents of the log file, deserialized, converted into a list
IFormatter serializer=new BinaryFormatter ();
var obj = serializer.deserialize (crstream) as list<string>;
The added content is then put into the list, which is serialized into the list object. Complete the operation, and this method resolves the problem.
Another way is to get rid of the serialization, generate a cipher string each time and then deposit txt, read one line at a time, compile one line. This method, the mixing degree does not have the upper method good.
Log logs using sequence deserialization encryption (serializer) Descrypto encryption