请问怎么用C#在文本文件中插入字符????

解决方案 »

  1.   

    using (StreamWriter sw = new StreamWriter("TestFile.txt")) 
            {
                // Add some text to the file.
                sw.Write("This is the ");
                sw.WriteLine("header for the file.");
                sw.WriteLine("-------------------");
                // Arbitrary objects can also be written to the file.
                sw.Write("The date is: ");
                sw.WriteLine(DateTime.Now);
            }
      

  2.   

    参看这篇文章讲到的stream操作误区
    http://blog.csdn.net/Knight94/archive/2006/08/25/1116346.aspx
      

  3.   

    http://blog.csdn.net/Knight94/archive/2006/08/25/1116346.aspx
    不错文章