Method | Description | |
---|---|---|
BeginDownload ( ) : void |
Start to download using ThreadPool.
|
|
BeginResume ( ) : void |
Resume the download using ThreadPool.
|
|
Cancel ( ) : void |
Cancel the download.
|
|
CheckUrl ( string &fileName ) : void |
Check the Uri to find its size, and whether it supports "Pause".
|
|
Download ( ) : void |
Start to download.
|
|
HttpDownloadClient ( string url ) : System |
Download the whole file.
|
|
HttpDownloadClient ( string url, long startPoint ) : System |
Download the file from a start point to the end.
|
|
HttpDownloadClient ( string url, long startPoint, long endPoint ) : System |
Download a block of the file. The default buffer size is 1KB, memory cache is 1MB, and buffer count per notification is 64.
|
|
HttpDownloadClient ( string url, long startPoint, long endPoint, int bufferSize, int cacheSize, int bufferCountPerNotification ) : System | ||
Pause ( ) : void |
Pause the download.
|
|
Resume ( ) : void |
Resume the download.
|
Method | Description | |
---|---|---|
OnDownloadCompleted ( |
The method will be called by the OnStatusChanged method.
|
|
OnDownloadProgressChanged ( DownloadProgressChangedEventArgs e ) : void | ||
OnStatusChanged ( |
Method | Description | |
---|---|---|
CheckFileOrCreateFile ( ) : void |
Check whether the destination file exists. If not, create a file with the same size as the file to be downloaded.
|
|
CheckUrlAndFile ( string &fileName ) : void | ||
DownloadInternal ( object obj ) : void |
Download the data using HttpWebRequest. It will read a buffer of bytes from the response stream, and store the buffer to a MemoryStream cache first. If the cache is full, or the download is paused, canceled or completed, write the data in cache to local file.
|
|
EnsurePropertyValid ( ) : void | ||
InternalDownloadProgressChanged ( int cachedSize ) : void |
Calculate the download speed and fire the DownloadProgressChanged event.
|
|
WriteCacheToFile ( |
Write the data in cache to local file.
|
public HttpDownloadClient ( string url ) : System | ||
url | string | |
return | System |
public HttpDownloadClient ( string url, long startPoint ) : System | ||
url | string | |
startPoint | long | |
return | System |
public HttpDownloadClient ( string url, long startPoint, long endPoint ) : System | ||
url | string | |
startPoint | long | |
endPoint | long | |
return | System |
public HttpDownloadClient ( string url, long startPoint, long endPoint, int bufferSize, int cacheSize, int bufferCountPerNotification ) : System | ||
url | string | |
startPoint | long | |
endPoint | long | |
bufferSize | int | |
cacheSize | int | |
bufferCountPerNotification | int | |
return | System |
protected OnDownloadCompleted ( |
||
e | ||
return | void |
protected OnDownloadProgressChanged ( DownloadProgressChangedEventArgs e ) : void | ||
e | DownloadProgressChangedEventArgs | |
return | void |
protected OnStatusChanged ( |
||
e | ||
return | void |