private void button1_Click(object sender, EventArgs e)
{
System.IO.MemoryStream mstream = new System.IO.MemoryStream();
this.richTextBox.SaveFile(mstream, RichTextBoxStreamType.RichText);
bWrite = mstream.ToArray();
//如需儲存,則以二進制的形式存入資料庫.
//sqlHelper.RunSql("insert into XXX (XX) values (@XX)", pram);
}
private void button2_Click(object sender, EventArgs e)
// DataTable dt=sqlHelper.GetDataTable("select XX from XXX where .....");
// byte[] bWrite = (byte[])dt.Rows[0][0];
System.IO.MemoryStream mstream = new System.IO.MemoryStream(bWrite, false);
this.richTextBox.LoadFile(mstream, RichTextBoxStreamType.RichText);