Справочник функций

Ваш аккаунт

Войти через: 
Забыли пароль?
Регистрация
Информацию о новых материалах можно получать и без регистрации:

Почтовая рассылка

Подписчиков: -1
Последний выпуск: 19.06.2015

Прокомментируйте код M$ Visual C++ 6

13K
10 сентября 2007 года
Wintos
10 / / 04.03.2006
CString CMD5Checksum::GetMD5(CFile& File)
{
try
{
CMD5Checksum MD5Checksum; //checksum object
int nLength = 0; //number of bytes read from the file
const int nBufferSize = 1024; //checksum the file in blocks of 1024 bytes
BYTE Buffer[nBufferSize]; //buffer for data read from the file

//checksum the file in blocks of 1024 bytes
while ((nLength = File.Read( Buffer, nBufferSize )) > 0 )
{
MD5Checksum.Update( Buffer, nLength );
}

//finalise the checksum and return it
return MD5Checksum.Final();
}

//report any file exceptions in debug mode only
catch (CFileException* e )
{
TRACE0("CMD5Checksum::GetMD5: CFileException caught");
throw e;
}
}
Реклама на сайте | Обмен ссылками | Ссылки | Экспорт (RSS) | Контакты
Добавить статью | Добавить исходник | Добавить хостинг-провайдера | Добавить сайт в каталог