Streamwriter overwriting the text in txtfile

放肆的年华 提交于 2019-12-02 11:51:07

Use the overload that asks you if you want to append

public StreamWriter(
    string path,
    bool append
)

http://msdn.microsoft.com/en-us/library/36b035cb.aspx

You can pass stream object to WriteEven() and WriteOdd() methods.

public void WriteOdd(StreamWiter writer)
{
  for (int i = 1; i < array.Length; i += 2)
  ...
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!