C#操作txt文件,进行清空添加操作的例子。代码://把txt清空FileStreamstream=File.Open(Adr,FileMode.OpenOrCreate,FileAccess.Write);stream.Seek(0,SeekOrigin.Begin);stream.SetLength(0);stream.Close();//向txt里面追加信息StreamWritersw=newStreamWriter(Adr,true,Encoding.GetEncoding...
查看全文