c# 개인 서명을 메모리로 읽기
//<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 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
SQLite의 query로 망설임이것은 내가 처음 안드로이드 응용 프로그램 개발에서 망설이고, 그 후 해결 된 방법을 비망록으로 철자하고 있습니다. java에서 SQLite를 이용한 애플리케이션을 작성하는 동안 EditText에 입력된 item이 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.