private void button1_Click(object sender, EventArgs e) { string aa = this.richTextBox1.Text.Trim(); StreamWriter sfile = new StreamWriter("E://123.txt");//写入到123.txt文件中 sfile.Write(aa); sfile.Close(); StreamReader ss = new StreamReader("E://123.txt");//读取文件123.txt中的内容 this.richTextBox2.Text = ss.ReadLine(); ss.Close(); }