xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡介

使用BackgroundWorker 實(shí)現(xiàn)文件下載、異步提示 準(zhǔn)備做一個(gè)可視化的WinForm界面,這就需要反映文件下載進(jìn)度,要達(dá)到這個(gè)實(shí)時(shí)報(bào)告進(jìn)度的功能,就需要進(jìn)行異步操作,可以通過線程或BackgroundWorker 類去實(shí)現(xiàn), 由于BackgroundWorker 類是.net2.0新增的組件類,所以想體驗(yàn)一下,以后面的文章中將會(huì)給出使用線程的方法。 詳細(xì)信息見:http://blog.csdn.net/wguorun/archive/2008/10/30/3183863.aspx

資源截圖

代碼片段和文件信息

using?System;
using?System.Net;
using?System.Net.Sockets;
using?System.Text;
using?System.IO;

namespace?FtpClient
{
????///?
????///?FTP?操作類
????///?

????public?class?FTP
????{
????????private?string?strRemoteHost;
????????private?int?strRemotePort;
????????private?string?strRemotePath;
????????private?string?strRemoteUser;
????????private?string?strRemotePass;
????????private?Boolean?bConnected;

????????#region?內(nèi)部變量
????????///?
????????///?服務(wù)器返回的應(yīng)答信息(包含應(yīng)答碼)
????????///?

????????private?string?strMsg;
????????///?
????????///?服務(wù)器返回的應(yīng)答信息(包含應(yīng)答碼)
????????///?

????????private?string?strReply;
????????///?
????????///?服務(wù)器返回的應(yīng)答碼
????????///?

????????private?int?iReplyCode;
????????///?
????????///?進(jìn)行控制連接的socket
????????///?

????????private?Socket?socketControl;
????????///?
????????///?傳輸模式
????????///?

????????private?TransferType?trType;
????????///?
????????///?傳輸模式:二進(jìn)制類型、ASCII類型
????????///?

????????public?enum?TransferType
????????{
????????????///?
????????????///?Binary
????????????///?

????????????Binary
????????????///?
????????????///?ASCII
????????????///?

????????????ASCII
????????};

????????///?
????????///?接收和發(fā)送數(shù)據(jù)的緩沖區(qū)
????????///?

????????private?static?int?BLOCK_SIZE?=?512;
????????Byte[]?buffer?=?new?Byte[BLOCK_SIZE];
????????///?
????????///?編碼方式
????????///?

????????Encoding?ASCII?=?Encoding.Default;
????????#endregion

????????#region?內(nèi)部函數(shù)

????????#region?構(gòu)造函數(shù)
????????///?
????????///?缺省構(gòu)造函數(shù)
????????///?

????????public?FTP()
????????{
????????????strRemoteHost?=?““;
????????????strRemotePath?=?““;
????????????strRemoteUser?=?““;
????????????strRemotePass?=?““;
????????????strRemotePort?=?21;
????????????bConnected?=?false;
????????}

????????///?
????????///?構(gòu)造函數(shù)
????????///?

????????///?The?remote?host.
????????///?The?remote?path.
????????///?The?remote?user.
????????///?The?remote?pass.
????????///?The?remote?port.
????????public?FTP(string?remoteHost?string?remotePath?string?remoteUser?string?remotePass?int?remotePort)
????????{
????????????strRemoteHost?=?remoteHost;
????????????strRemotePath?=?remotePath;
????????????strRemoteUser?=?remoteUser;
????????????strRemotePass?=?remotePass;
????????????strRemotePort?=?remotePort;
????????????Connect();
????????}
????????///?
????????///?Initializes?a?new?instance?of?the??class.
????????///?

????????///?The?remote?host.
????????///?The?remote?path.
????????///?

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件??????????0??2008-10-28?17:22??bin\Debug\ex081028.log

?????文件??????????0??2008-10-29?09:48??bin\Debug\ex081029.log

?????文件??????????0??2008-10-30?12:53??bin\Debug\ex081030.log

?????文件??????27648??2008-10-29?10:21??bin\Debug\FtpClient.exe

?????文件??????75264??2008-10-29?10:21??bin\Debug\FtpClient.pdb

?????文件??????14328??2008-10-30?09:59??bin\Debug\FtpClient.vshost.exe

?????文件????????490??2007-07-21?02:33??bin\Debug\FtpClient.vshost.exe.manifest

?????文件????????720??2008-10-30?09:59??obj\Debug\FtpClient.csproj.FileListAbsolute.txt

?????文件???????1117??2008-10-29?10:20??obj\Debug\FtpClient.csproj.GenerateResource.Cache

?????文件??????27648??2008-10-29?10:21??obj\Debug\FtpClient.exe

?????文件????????180??2008-10-29?10:20??obj\Debug\FtpClient.FtpDownLoadForm.resources

?????文件????????180??2008-10-29?10:20??obj\Debug\FtpClient.FtpWebResponseDemo.resources

?????文件??????75264??2008-10-29?10:21??obj\Debug\FtpClient.pdb

?????文件????????180??2008-10-29?10:20??obj\Debug\FtpClient.Properties.Resources.resources

?????文件???????1374??2008-10-06?09:33??Properties\AssemblyInfo.cs

?????文件???????2868??2008-10-06?09:33??Properties\Resources.Designer.cs

?????文件???????5612??2008-10-06?09:33??Properties\Resources.resx

?????文件???????1094??2008-10-06?09:33??Properties\Settings.Designer.cs

?????文件????????249??2008-10-06?09:33??Properties\Settings.settings

?????文件??????28840??2008-10-29?10:18??FTP.cs

?????文件???????3842??2008-10-29?10:20??FtpClient.csproj

?????文件???????7408??2008-10-30?15:07??FtpDownLoadForm.cs

?????文件??????11077??2008-10-29?10:20??FtpDownLoadForm.Designer.cs

?????文件???????6229??2008-10-29?10:00??FtpDownLoadForm.resx

?????文件???????1418??2008-10-28?16:16??FtpState.cs

?????文件???????5468??2008-10-29?10:19??FtpWebResponseDemo.cs

?????文件???????8544??2008-10-29?10:19??FtpWebResponseDemo.Designer.cs

?????文件???????6427??2008-10-28?15:06??FtpWebResponseDemo.resx

?????文件????????480??2008-10-29?10:20??Program.cs

?????目錄??????????0??2008-10-30?15:05??obj\Debug\Refactor

............此處省略9個(gè)文件信息

評(píng)論

共有 條評(píng)論