zoukankan      html  css  js  c++  java
  • C# 将RichTextBox中内容的文档以二进制形式存

    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);

            }

  • 相关阅读:
    hashlib模块
    logging模块
    Python的富比较方法
    格式化符号说明
    __str__与__repr__区别
    2014-07-18 10:25

    2014-07-17 17:04
    2014-07-17 16:44
    2014-07-16 15:54
  • 原文地址:https://www.cnblogs.com/ribavnu/p/4807443.html
Copyright © 2011-2022 走看看