C# Class BiliRanking.Core.TSDownload

Afficher le fichier Open project: SkiTiSu/BiliRanking Class Usage Examples

Méthodes publiques

Свойство Type Description
DownloadedBytes long
Percent float
Progressbar System.Windows.Forms.ProgressBar
Speed long
TotalBytes long

Méthodes publiques

Méthode Description
GetCutFileName ( string url ) : string

根据下载地址获取文件名(截尾)

GetFileName ( string url ) : string

根据HTTP头文件并转码获取文件名

Start ( ) : void

开始下载(如文件已存在则自动加(n))

StartWithoutThread ( ) : void
Stop ( ) : void

停止下载

TSDownload ( ) : System

默认构造函数

TSDownload ( string url ) : System

构造函数,下载到同目录下,保存的文件名通过url转换

TSDownload ( string url, string filename ) : System

构造函数

removeInvChrInPath ( string origFileOrPathStr ) : string

删除路径和文件名中的非法字符 http://www.crifan.com/files/doc/docbook/crifanlib_csharp/release/webhelp/removeinvchrinpath.html

tims_Elapsed ( object sender, System e ) : void

Private Methods

Méthode Description
SetPbM ( int n ) : void

修改进度条总大小

SetPbV ( int n ) : void

修改进度条已下载大小

ThreadDL ( ) : void

下载专用线程的方法

Method Details

GetCutFileName() public static méthode

根据下载地址获取文件名(截尾)
public static GetCutFileName ( string url ) : string
url string 下载地址
Résultat string

GetFileName() public static méthode

根据HTTP头文件并转码获取文件名
public static GetFileName ( string url ) : string
url string 下载地址
Résultat string

Start() public méthode

开始下载(如文件已存在则自动加(n))
public Start ( ) : void
Résultat void

StartWithoutThread() public méthode

public StartWithoutThread ( ) : void
Résultat void

Stop() public méthode

停止下载
public Stop ( ) : void
Résultat void

TSDownload() public méthode

默认构造函数
public TSDownload ( ) : System
Résultat System

TSDownload() public méthode

构造函数,下载到同目录下,保存的文件名通过url转换
public TSDownload ( string url ) : System
url string 下载地址
Résultat System

TSDownload() public méthode

构造函数
public TSDownload ( string url, string filename ) : System
url string 下载地址
filename string 保存的文件名(可包含绝对路径)
Résultat System

removeInvChrInPath() public static méthode

删除路径和文件名中的非法字符 http://www.crifan.com/files/doc/docbook/crifanlib_csharp/release/webhelp/removeinvchrinpath.html
public static removeInvChrInPath ( string origFileOrPathStr ) : string
origFileOrPathStr string
Résultat string

tims_Elapsed() public méthode

public tims_Elapsed ( object sender, System e ) : void
sender object
e System
Résultat void

Property Details

DownloadedBytes public_oe property

已下载大小(字节)
public long DownloadedBytes
Résultat long

Percent public_oe property

已下载百分比
public float Percent
Résultat float

Progressbar public_oe property

(可选)进度条
public ProgressBar,System.Windows.Forms Progressbar
Résultat System.Windows.Forms.ProgressBar

Speed public_oe property

public long Speed
Résultat long

TotalBytes public_oe property

总大小(字节)
public long TotalBytes
Résultat long