关于文本文档的加密
c#编程,怎么对文本文档中字符进行加密,方法是用ASCLL值减10
string fileName = AppDomain.CurrentDomain.BaseDirectory + "Exam1.txt";
FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.ReadWrite);
StreamWriter sw = new StreamWriter(fs);
string Str = "";
foreach (char c in fileName.ToCharArray())
{
Str += Encoding.ASCII.GetString(new byte[] { (byte)(c-10) });
}
sw.Write(Str);
MessageBox.Show("加密成功!");
sw.Close();
fs.Close();