예제 #1
0
 public void DownloadFileSize(string url, int timeout, Action <bool, int, int> complete)
 {
     _EventQueue.Clear();
     _currParams = new SWebDownloadParams();
     _currParams.download_url   = url;
     _currParams.timeout        = timeout;
     _currParams.OnSizeComplete = complete;
     ThreadPool.SetMaxThreads(1, 1);
     ThreadPool.QueueUserWorkItem(new WaitCallback(DownloadFileSizeCallback), null);
 }
예제 #2
0
 public void DownloadFile(string download_url, string localPath_url, int timeout, Action <SDownloadFileResult> progress, Action <int> complete)
 {
     _EventQueue.Clear();
     _currParams = new SWebDownloadParams();
     _currParams.download_url  = download_url;
     _currParams.localPath_url = localPath_url;
     _currParams.timeout       = timeout;
     _currParams.OnProgress    = progress;
     _currParams.OnComplete    = complete;
     _fileResult = new SDownloadFileResult();
     ThreadPool.SetMaxThreads(5, 5);
     ThreadPool.QueueUserWorkItem(new WaitCallback(DownloadFileCallback), null);
 }