中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

c#讀取個人簽名到內存

發布時間:2020-03-21 23:31:22 來源:網絡 閱讀:464 作者:flybear006 欄目:編程語言
//<summary>
         //<newpara>方法功能:讀取個人簽名到內存</newpara>
         //</summary>
         //<param name="vMarkName"></param>
         //<param name="vPassWord"></param>
         //<returns></returns>
        private byte[] LoadMarkImage(string szSql)
        {
            //bool mResult = false;
            byte[] m_bytFileBody = null;
            System.IO.MemoryStream oStream = null;
            System.IO.BinaryWriter oWriter = null;
            try
            {
                //string szSelectCmd = "SELECT c.MarkBody FROM OA_ESignature c where c.CO='XF01' and c.UserId='" + userid + "'";
                //if (m_oDbHelper == null)
                //{
                //    m_oDbHelper = new DbHelper();
                //}
                //m_oDbHelper.OpenDbResource();
                 
                DbCommand mCommand = m_oDbHelper.CreateDbCommand();
                mCommand.CommandType = CommandType.Text;
                mCommand.CommandText = szSql;
                IDataReader oReader = mCommand.ExecuteReader(System.Data.CommandBehavior.SequentialAccess);
               // LogCentral.CurrentLogger.LogInfo();
                if (oReader.Read())
                {
                    if (!oReader.IsDBNull(0))
                    {
                        int bufferSize = 500;                         // Size of the BLOB buffer.
                        byte[] outbyte = new byte[bufferSize];        // The BLOB byte[] buffer to be filled by GetBytes.
                        long retval;                                  // The bytes returned from GetBytes.
                        long startIndex = 0;                          // The starting position in the BLOB output.
                        // Get ACL By BLOB ColumnType
                        oStream = new System.IO.MemoryStream();
                        oWriter = new System.IO.BinaryWriter(oStream, System.Text.Encoding.UTF8);
                        startIndex = 0;
                        retval = oReader.GetBytes(0, startIndex, outbyte, 0, bufferSize); //ItemACL
                        // Continue reading and writing while there are bytes beyond the size of the buffer.
                        while (retval == bufferSize)
                        {
                            oWriter.Write(outbyte);
                            oWriter.Flush();
                            startIndex += bufferSize;
                            retval = oReader.GetBytes(0, startIndex, outbyte, 0, bufferSize); //ItemACL
                        }
                        // Write the remaining buffer.
                        oWriter.Write(outbyte, 0, (int)retval);
                    }
                    //m_szFileType = oReader.GetString(1).ToString();
                   // mResult = true;
                }
                //else
                //{
                //    mResult = false;
                //}
                oReader.Close();
                oReader = null;
                m_bytFileBody = oStream.GetBuffer();
                //LogCentral.CurrentLogger.LogInfo("m_bytFileBody:" + m_bytFileBody.ToString());
                LogCentral.CurrentLogger.LogInfo("m_bytFileBody:" + m_bytFileBody.Length);
            }
            catch (Exception e)
            {
                LogCentral.CurrentLogger.LogInfo(e.ToString());
                //mResult = false;
            }
            finally
            {
                //m_oDbHelper.CloseDbResource();
                try
                {
                    if (oWriter != null)
                    {
                        oWriter.Flush();
                        oWriter.Close();
                    }
                }
                catch { }
                try
                {
                    if (oStream != null)
                        oStream.Close();
                }
                catch { }
            }
            return m_bytFileBody;
        }


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

香河县| 聊城市| 齐齐哈尔市| 青浦区| 久治县| 莱州市| 德惠市| 五峰| 义乌市| 娱乐| 菏泽市| 安宁市| 沙坪坝区| 巴彦淖尔市| 永春县| 大连市| 柳江县| 通江县| 三原县| 府谷县| 武威市| 甘谷县| 宣威市| 望谟县| 道孚县| 明溪县| 涞水县| 九龙城区| 汽车| 中山市| 大安市| 民县| 永宁县| 红河县| 滕州市| 伊金霍洛旗| 玉屏| 宜春市| 木里| 安徽省| 镇远县|