Class for downloading files in the background that supports info about their progress, the total progress, cancellation, pausing, and resuming. The downloads will run on a separate thread so you don't have to worry about multihreading yourself.
Class FileDownloader v1.0.2, by De Dauw Jeroen - April 2009
Inheritance: System.Object, IDisposable
Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();
            this.Icon = global::UODownloader.Properties.Resources.c25;
            this.notifyIcon1.Icon = this.Icon;

            _downloader = new FileDownloader(true);
            _downloader.ProgressChanged += new EventHandler(downloader_ProgressChanged);
            _downloader.StateChanged += new EventHandler(downloader_StateChanged);
            _downloader.FileDownloadStarted += new EventHandler(downloader_FileDownloadStarted);
            _downloader.FileDownloadSucceeded += new EventHandler(downloader_FileDownloadCompleted);
            _downloader.FileDownloadStopped += new EventHandler(downloader_FileDownloadStopped);
        }
Ejemplo n.º 2
0
 /// <summary>Format an amount of bytes to a more readible notation with decimal notation symbols</summary>
 /// <param name="size">Required. Int64. The raw amount of bytes</param>
 public static string FormatSizeDecimal(Int64 size)
 {
     return(FileDownloader.FormatSizeDecimal(size, default_decimals));
 }