//创建
FileStream fs = File.Create(@"D:/test.txt");
StreamWriter sw = new StreamWriter(fs);
sw.WriteLine("112233445566");
sw.Close();
fs.Close();
//读取
FileStream fss = File.OpenRead(@"D:/test.txt");
StreamReader sr = new StreamReader(fss);
string s = sr.ReadLine();
MessageBox.Show(s);
sr.Close();
fss.Close();
//增加
List<string> list = new List<string>();
list.Add("123456798");
File.AppendAllLines(@"D:/test.txt", list);
File.AppendAllText(@"D:/test.txt", "987654321");
StreamWriter swww= File.AppendText(@"D:/test.txt");
swww.WriteLine();
swww.WriteLine("555555");
swww.Close();