使用C#读写文件 [英] Reading and writing a file using c#

查看:53
本文介绍了使用C#读写文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须借助密码学来读取,写入内容并将内容(字符串值)附加到文件中.
对于单行文本,它可以正确读取内容,但是当我添加第二行内容时,它将读取第一行的内容,并在下一行的开头给出一些错误字符.
所以我的问题是如何使用FileStream Write和Append方法取回写到文件中的数据?

I have to read, write and append content (string value) to a file with the help of Cryptography.
For a single line of text it reads the content correctly but when I append a second line content it reads the content of first line and gives some bad characters at the start of next line.
So my question is how do I get my data back which was written to a file using FileStream Write and Append method?

推荐答案

使用System.Security.Cryptography类.
请在此处查看此msdn文章 [ ^ ].
Make use of the System.Security.Cryptography class.
See this msdn article here[^].


这篇关于使用C#读写文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆