下面是读取信件信体的一段代码,有些不太明白
void CMailMessage::DecodeBody()
{
CString sCooked = "";
LPTSTR szBad = "\r\n..\r\n";
LPTSTR szGood = "\r\n.\r\n";
int nPos;
int nBadLength = strlen( szBad );
if( m_sBody.Left( 4 ) == "..\r\n" )
m_sBody = m_sBody.Mid(1);
while( (nPos = m_sBody.Find( szBad )) > -1 )
{
sCooked = m_sBody.Mid( 0, nPos );
sCooked += szGood;
m_sBody =sCooked+ m_sBody.Right( m_sBody.GetLength() - (nPos + nBadLength) );
}
}
程序运行出来信体部分是
-----=_Part_289181_79146947.1401189930373
Content-Type: text/plain; charset=GBK
Content-Transfer-Encoding: 7bit
123
------=_Part_289181_79146947.1401189930373
Content-Type: text/html; charset=GBK
Content-Transfer-Encoding: 7bit
------=_Part_289181_79146947.1401189930373--
请各位大神指教一下,我要怎么样修改程序才能让信体部分只显示 123 呢?