C# 클래스 BiliRanking.Core.Download.HttpDownloadClient

상속: IDownloader
파일 보기 프로젝트 열기: SkiTiSu/BiliRanking 1 사용 예제들

공개 메소드들

메소드 설명
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.

보호된 메소드들

메소드 설명
OnDownloadCompleted ( DownloadCompletedEventArgs e ) : void

The method will be called by the OnStatusChanged method.

OnDownloadProgressChanged ( DownloadProgressChangedEventArgs e ) : void
OnStatusChanged ( EventArgs e ) : void

비공개 메소드들

메소드 설명
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 ( MemoryStream downloadCache, int cachedSize ) : void

Write the data in cache to local file.

메소드 상세

BeginDownload() 공개 메소드

Start to download using ThreadPool.
public BeginDownload ( ) : void
리턴 void

BeginResume() 공개 메소드

Resume the download using ThreadPool.
public BeginResume ( ) : void
리턴 void

Cancel() 공개 메소드

Cancel the download.
public Cancel ( ) : void
리턴 void

CheckUrl() 공개 메소드

Check the Uri to find its size, and whether it supports "Pause".
public CheckUrl ( string &fileName ) : void
fileName string
리턴 void

Download() 공개 메소드

Start to download.
public Download ( ) : void
리턴 void

HttpDownloadClient() 공개 메소드

Download the whole file.
public HttpDownloadClient ( string url ) : System
url string
리턴 System

HttpDownloadClient() 공개 메소드

Download the file from a start point to the end.
public HttpDownloadClient ( string url, long startPoint ) : System
url string
startPoint long
리턴 System

HttpDownloadClient() 공개 메소드

Download a block of the file. The default buffer size is 1KB, memory cache is 1MB, and buffer count per notification is 64.
public HttpDownloadClient ( string url, long startPoint, long endPoint ) : System
url string
startPoint long
endPoint long
리턴 System

HttpDownloadClient() 공개 메소드

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
리턴 System

OnDownloadCompleted() 보호된 메소드

The method will be called by the OnStatusChanged method.
protected OnDownloadCompleted ( DownloadCompletedEventArgs e ) : void
e DownloadCompletedEventArgs
리턴 void

OnDownloadProgressChanged() 보호된 메소드

protected OnDownloadProgressChanged ( DownloadProgressChangedEventArgs e ) : void
e DownloadProgressChangedEventArgs
리턴 void

OnStatusChanged() 보호된 메소드

protected OnStatusChanged ( EventArgs e ) : void
e System.EventArgs
리턴 void

Pause() 공개 메소드

Pause the download.
public Pause ( ) : void
리턴 void

Resume() 공개 메소드

Resume the download.
public Resume ( ) : void
리턴 void