打开文件流:
FileStream fs = new FileStream(@"d:\2.txt",FileMode.Open,FileAccess.ReadWrite);
StreamWriter sw = new StreamWriter(fs);
定位指针:
sw.BaseStream.Seek(0, SeekOrigin.End);
写缓冲区:
sw.Write(string a);
写入文件:
sw.Flush();
最后关闭文件:sw.Close();
posted on 2010-03-02 20:56
蔗晨 阅读(169)
评论(0) 编辑 收藏 引用