Source Code for Me (s-c.me)

Allows you to paste souce code to blogs! Adapted for Twitter! Here is Search Form in case you missed your code.
Code:
Selected Language:
Show Linenumbers:
Short link for Twitter:
HTML:

HTML view:

Copy Source | Copy HTML
Downloader::Init(); // Ð˜Ð½Ð¸Ñ†Ð¸Ð°Ð»Ð¸Ð·Ð¸Ñ€ÑƒÐµÐ¼ cURL
 
Downloader::DFile* remoteFile = new Downloader::DFile;
 
// Ð§Ñ‚о Ð±ÑƒÐ´ÐµÐ¼ ÑÐºÐ°Ñ‡Ð¸Ð²Ð°Ñ‚ÑŒ, Ð´Ð»Ñ Ñ‚ого Ñ‡Ñ‚о ÑƒÐ²ÐµÐ´Ð¸Ñ‚ÑŒ Ð¿Ñ€Ð¾Ð³Ñ€ÐµÑÑ Ð½Ð°Ð´Ð¾ ÑÐºÐ°Ñ‡Ð¸Ð²Ð°Ñ‚ÑŒ Ð±Ð¾Ð»ÑŒÑˆÐ¾Ð¹ Ñ„айл
remoteFile->SetURL( "http://habrahabr.ru/i/bg-multilogo.png" );
remoteFile->SetToFile( "habra-logo.png" );
remoteFile->DownloadThread();
 
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" );
else
    printf( "\rDownload error %s\n", remoteFile->GetError() );
 
remoteFile->Clean(); // Ð¡Ð±Ñ€Ð¾ÑÐ¸Ð¼ Ð²ÑÐµ, Ñ‡Ñ‚о Ð±Ñ‹ Ð±ÐµÐ·Ð±Ð¾Ð»ÐµÐ·Ð½ÐµÐ½Ð½Ð¾ Ð¸ÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÑŒ Ð¾Ð±ÑŠÐµÐºÑ‚ ÑÐ½Ð¾Ð²Ð°
 
remoteFile->SetURL( "http://habrahabr.ru/js/1270814916/system.js" );
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