private void create()
{
RichTextBox txt = new RichTextBox();
txt.Text += "1 \n";
txt.Text += "2 \n";
txt.Text += "3 \n";
richTextBox1.Text = txt.Text;
richTextBox1.SaveFile(Application.StartupPath + "\\1.txt", RichTextBoxStreamType.TextTextOleObjs);
}
{
RichTextBox txt = new RichTextBox();
txt.Text += "1 \n";
txt.Text += "2 \n";
txt.Text += "3 \n";
richTextBox1.Text = txt.Text;
richTextBox1.SaveFile(Application.StartupPath + "\\1.txt", RichTextBoxStreamType.TextTextOleObjs);
}
http://technet.microsoft.com/zh-cn/library/system.windows.forms.richtextboxstreamtype
richTextBox1.SaveFile(Application.StartupPath + "\\2.txt", RichTextBoxStreamType.TextTextOleObjs);
如果写两行,第二行生成的就没有问题,第一行就是0字节,我就是一个晕啊..
新版的不知道解决了没有