string messege = "...";FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Write);
StreamWriter  srd = new StreamWriter(fs);srd.WriteLine(messege);
srd.WriteLine();
srd.Close();
我这样写每次都会覆盖掉,而我想在原内容后另起一行继续写入。急!

解决方案 »

  1.   

    FileStream fs = new FileStream(path, FileMode.Open, FileAccess.WriteAccse);
    好象是这么写 就是这个参数的模式改一下就好了
      

  2.   

    FileStream fs = new FileStream(path, FileMode.Append, FileAccess.Write)
      

  3.   

    还是 srd.append()
    忘的差不多了...=.=
    hehe 
      

  4.   


    StreamReader sr = new StreamReader(path);
    string content = sr.ReadToEnd();
    content+="\n"+message;
    sr.Close();
    StreamWriter sw = new StreamWriter(path,false);
    foreach(string s in result)
        sw.WriteLine(s);
    sw.Close();
      

  5.   

    改成这个模式后就可以了,真谢谢大家。
    今天问了三个问题全部解决太开心了!CSDN真不错!