将RichTextBox的内容直接写入数据库:
private void button1_Click(object sender, EventArgs e)
{
System.IO.MemoryStream mstream = new System.IO.MemoryStream();
this.richTextBox1.SaveFile(mstream, RichTextBoxStreamType.RichText);
//将流转换成数组
byte[] bWrite = mstream.ToArray();
//将数组写入数据库
System.Data.SqlClient.S
2022-04-14 13:29:46
20KB
c
ex
ext
1