C# Class BiliRanking.Core.TSDownload

显示文件 Open project: SkiTiSu/BiliRanking Class Usage Examples

Public Properties

Property Type Description
DownloadedBytes long
Percent float
Progressbar System.Windows.Forms.ProgressBar
Speed long
TotalBytes long

Public Methods

Method 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

Method Description
SetPbM ( int n ) : void

修改进度条总大小

SetPbV ( int n ) : void

修改进度条已下载大小

ThreadDL ( ) : void

下载专用线程的方法

Method Details

GetCutFileName() public static method

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

GetFileName() public static method

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

Start() public method

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

StartWithoutThread() public method

public StartWithoutThread ( ) : void
return void

Stop() public method

停止下载
public Stop ( ) : void
return void

TSDownload() public method

默认构造函数
public TSDownload ( ) : System
return System

TSDownload() public method

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

TSDownload() public method

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

removeInvChrInPath() public static method

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

tims_Elapsed() public method

public tims_Elapsed ( object sender, System e ) : void
sender object
e System
return void

Property Details

DownloadedBytes public_oe property

已下载大小(字节)
public long DownloadedBytes
return long

Percent public_oe property

已下载百分比
public float Percent
return float

Progressbar public_oe property

(可选)进度条
public ProgressBar,System.Windows.Forms Progressbar
return System.Windows.Forms.ProgressBar

Speed public_oe property

public long Speed
return long

TotalBytes public_oe property

总大小(字节)
public long TotalBytes
return long