richtextbox的回车和记事本的回车不一样!你用写字板打开你的temp.txt看看!
可能需要插入\r,richtextbox只有\n

解决方案 »

  1.   

    怎么插入,是在richtextbox每一行结束时候键如\r\n吗?
      

  2.   

    我试过了,这样不行,他直接在temp.txt中就写出来了\r\n,而没有把\r\n当做回车来看
      

  3.   

    try:StreamWriter myWrite = null;
    Stream myStream=System.IO.File.Open("temp.txt" ,FileMode.OpenOrCreate,
    FileAccess.ReadWrite ,FileShare.None );
    myWrite = new StreamWriter(myStream,System.Text.Encoding.Default );
    string wrBuff = "";
    foreach(string s in this.richTextBox1.Lines)
     wrBuff += s + "\r\n";
    myWrite.Write( wrBuff );
    myWrite.Close ();