欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

C#在txt类文件中追加内容

程序员文章站 2023-11-04 13:49:52
string path = "test.txt"; FileStream mystream = new FileStream(path, FileMode.OpenOrCreate); StreamWriter myWrite = new StreamWriter(mystream); myWrit ......

string path = "test.txt";
filestream mystream = new filestream(path, filemode.openorcreate);
streamwriter mywrite = new streamwriter(mystream);
mywrite.write(strwritelog);
mywrite.close();
mystream.close();