主题:[讨论]字符拆解问题,来牛人指导下
FieldPtr pField = m_pTestResultSet->Fields->GetItem(_T("tTestReport"));
int nFileLen = file.GetLength();
int nBlock = nFileLen / BLOCK_SIZE;
int nLeft = nFileLen % BLOCK_SIZE;
int i, j;
for( i=0; i<nBlock; i++)
{
file.Read(cBlockBuf, BLOCK_SIZE);
for(j=0; j<BLOCK_SIZE; j++)
{
if ( cBlockBuf[j]==0 )
{
cBlockBuf[j] = 1;
}
}
cBlockBuf[BLOCK_SIZE] = '\0';
varDataBlock.SetString((char *)cBlockBuf);
pField->AppendChunk(varDataBlock);
}
file.Read(cBlockBuf, nLeft);
for(j=0; j<nLeft; j++)
{
if ( cBlockBuf[j]==0 )
{
cBlockBuf[j] = 1;
}
}
cBlockBuf[nLeft] = '\0';
varDataBlock.SetString((char *)cBlockBuf);
pField->AppendChunk(varDataBlock);
m_pTestResultSet->Update();
找个强人,写一个与这个字符拆解相反的方法,
[em18]
int nFileLen = file.GetLength();
int nBlock = nFileLen / BLOCK_SIZE;
int nLeft = nFileLen % BLOCK_SIZE;
int i, j;
for( i=0; i<nBlock; i++)
{
file.Read(cBlockBuf, BLOCK_SIZE);
for(j=0; j<BLOCK_SIZE; j++)
{
if ( cBlockBuf[j]==0 )
{
cBlockBuf[j] = 1;
}
}
cBlockBuf[BLOCK_SIZE] = '\0';
varDataBlock.SetString((char *)cBlockBuf);
pField->AppendChunk(varDataBlock);
}
file.Read(cBlockBuf, nLeft);
for(j=0; j<nLeft; j++)
{
if ( cBlockBuf[j]==0 )
{
cBlockBuf[j] = 1;
}
}
cBlockBuf[nLeft] = '\0';
varDataBlock.SetString((char *)cBlockBuf);
pField->AppendChunk(varDataBlock);
m_pTestResultSet->Update();
找个强人,写一个与这个字符拆解相反的方法,
[em18]