Source Code for Me (

Allows you to paste souce code to blogs! Adapted for Twitter! Here is Search Form in case you missed your code.
Tags: CSharp,Downloader, Created At: 10/24/2016 8:26:12 PMViews:

HTML view:
Copy Source | Copy HTML
Downloader::Init(); // Ð˜Ð½Ð¸Ñ†Ð¸Ð°Ð»Ð¸Ð·Ð¸Ñ€ÑƒÐµÐ¼ cURL
Downloader::DFile* remoteFile = new Downloader::DFile;
// Ð§Ñ‚о Ð±ÑƒÐ´ÐµÐ¼ ÑÐºÐ°Ñ‡Ð¸Ð²Ð°Ñ‚ÑŒ, Ð´Ð»Ñ Ñ‚ого Ñ‡Ñ‚о ÑƒÐ²ÐµÐ´Ð¸Ñ‚ÑŒ Ð¿Ñ€Ð¾Ð³Ñ€ÐµÑÑ Ð½Ð°Ð´Ð¾ ÑÐºÐ°Ñ‡Ð¸Ð²Ð°Ñ‚ÑŒ Ð±Ð¾Ð»ÑŒÑˆÐ¾Ð¹ Ñ„айл
remoteFile->SetURL( "" );
remoteFile->SetToFile( "habra-logo.png" );
while( remoteFile->GetState() <= Downloader::DFile::DFILE_STATE_DOWNLOADING ) // ÐŸÐ¾ÐºÐ° Ð¸Ð´ÐµÑ‚ ÑÐºÐ°Ñ‡ÐºÐ°
    printf( "\rDownloading... %.2f%%", remoteFile->GetPercent()*100.0f ); // Ð¿Ñ€Ð¾ÑÑ‚о Ð¾Ñ‚ображаем Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð½Ð¾ÑÑ‚ÑŒ
if( remoteFile->GetState() == Downloader::DFile::DFILE_STATE_COMPLETE )
    printf( "\rDownload complete.\n" );
    printf( "\rDownload error %s\n", remoteFile->GetError() );
remoteFile->Clean(); // Ð¡Ð±Ñ€Ð¾ÑÐ¸Ð¼ Ð²ÑÐµ, Ñ‡Ñ‚о Ð±Ñ‹ Ð±ÐµÐ·Ð±Ð¾Ð»ÐµÐ·Ð½ÐµÐ½Ð½Ð¾ Ð¸ÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÑŒ Ð¾Ð±ÑŠÐµÐºÑ‚ ÑÐ½Ð¾Ð²Ð°
remoteFile->SetURL( "" );
remoteFile->Work(); // Ð£Ð¶Ðµ Ð±ÐµÐ· Ð¿Ð¾Ñ‚ока ÑÐºÐ°Ñ‡Ð°ÐµÐ¼
if( remoteFile->GetState() == Downloader::DFile::DFILE_STATE_COMPLETE )
    printf( (const char*)remoteFile->GetData() );
delete remoteFile;
Downloader::Destroy(); // ÐžÑÐ²Ð¾Ð±Ð¾Ð´Ð¸Ð¼ Ñ€ÐµÑÑƒÑ€ÑÑ‹ Ð·Ð°Ð½Ð¸Ð¼Ð°ÐµÐ¼Ñ‹Ðµ cURL

Based on Manoli.Net's CodeFormatter. Made by Topbot (c) 2008-2018