文件复制备份

前几天硬盘坏了,资料都没有了,而且还没有备份,郁闷!写了个文件复制备份的程序,主要是将每天的程序备份到其他盘里面做好备份。直接文件拷贝时窗口不能移动,只好用线程来控制在后台复制,窗口显示文件大小和进度。windows复制拷贝文件都有时间预算的,这个不知道怎么实现了,呵呵,有知道的不要忘记告诉我一下,先谢了!
第一次写文章,有点晕晕的,希望大家看到的不是不知所云!

程序代码如下:

None.gif using  System;
None.gif
using  System.Drawing;
None.gif
using  System.Collections;
None.gif
using  System.ComponentModel;
None.gif
using  System.Windows.Forms;
None.gif
using  System.Data;
None.gif
using  System.IO;
None.gif
None.gif
namespace  FileCopy
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
ExpandedSubBlockStart.gifContractedSubBlock.gif    
/**//// <summary>
InBlock.gif    
/// Form1 的摘要说明。
ExpandedSubBlockEnd.gif    
/// </summary>

InBlock.gif    public class Form1 : System.Windows.Forms.Form
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
private System.Windows.Forms.Button ok;
InBlock.gif        
private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
InBlock.gif        
private System.Windows.Forms.Label label1;
InBlock.gif        
private System.Windows.Forms.Button button1;
InBlock.gif        
private System.Windows.Forms.Label label2;
InBlock.gif        
private System.Windows.Forms.Button button2;
InBlock.gif        
private System.Windows.Forms.TextBox textBoxBackScroue;
InBlock.gif        
private System.Windows.Forms.TextBox textBoxBackTrigger;
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 必需的设计器变量。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private System.ComponentModel.Container components = null;
InBlock.gif
InBlock.gif        ArrayList alFile 
= new ArrayList();
InBlock.gif        ArrayList alDir 
= new ArrayList();
InBlock.gif
InBlock.gif        
private System.Windows.Forms.Label labelFile;
InBlock.gif        
private System.Windows.Forms.Label labelDir;
InBlock.gif        
private System.Windows.Forms.ProgressBar progressBar1;
InBlock.gif
InBlock.gif        
int intParm = 0,intCopy =0;
InBlock.gif        
long longFileSize = 0, longFileCopyindSize = 0;
InBlock.gif        
private System.Windows.Forms.Label labelFileCopying;
InBlock.gif
InBlock.gif        
private System.Windows.Forms.Label labelFileSize;
InBlock.gif
InBlock.gif        
public Form1()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
InBlock.gif            
//
InBlock.gif            
// Windows 窗体设计器支持所必需的
InBlock.gif            
//
InBlock.gif
            InitializeComponent();
InBlock.gif
InBlock.gif            
//
InBlock.gif            
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
InBlock.gif            
//
ExpandedSubBlockEnd.gif
        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 清理所有正在使用的资源。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        protected override void Dispose( bool disposing )
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
if( disposing )
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
if (components != null
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    components.Dispose();
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }

InBlock.gif            
base.Dispose( disposing );
ExpandedSubBlockEnd.gif        }

InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif        
Windows 窗体设计器生成的代码#region Windows 窗体设计器生成的代码
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
InBlock.gif        
/// 此方法的内容。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private void InitializeComponent()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
this.ok = new System.Windows.Forms.Button();
InBlock.gif            
this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
InBlock.gif            
this.textBoxBackScroue = new System.Windows.Forms.TextBox();
InBlock.gif            
this.label1 = new System.Windows.Forms.Label();
InBlock.gif            
this.button1 = new System.Windows.Forms.Button();
InBlock.gif            
this.label2 = new System.Windows.Forms.Label();
InBlock.gif            
this.textBoxBackTrigger = new System.Windows.Forms.TextBox();
InBlock.gif            
this.button2 = new System.Windows.Forms.Button();
InBlock.gif            
this.labelFile = new System.Windows.Forms.Label();
InBlock.gif            
this.labelDir = new System.Windows.Forms.Label();
InBlock.gif            
this.progressBar1 = new System.Windows.Forms.ProgressBar();
InBlock.gif            
this.labelFileSize = new System.Windows.Forms.Label();
InBlock.gif            
this.labelFileCopying = new System.Windows.Forms.Label();
InBlock.gif            
this.SuspendLayout();
InBlock.gif            
// 
InBlock.gif            
// ok
InBlock.gif            
// 
InBlock.gif
            this.ok.Location = new System.Drawing.Point(9696);
InBlock.gif            
this.ok.Name = "ok";
InBlock.gif            
this.ok.TabIndex = 0;
InBlock.gif            
this.ok.Text = "拷贝";
InBlock.gif            
this.ok.Click += new System.EventHandler(this.ok_Click);
InBlock.gif            
// 
InBlock.gif            
// textBoxBackScroue
InBlock.gif            
// 
InBlock.gif
            this.textBoxBackScroue.Location = new System.Drawing.Point(568);
InBlock.gif            
this.textBoxBackScroue.Name = "textBoxBackScroue";
InBlock.gif            
this.textBoxBackScroue.ReadOnly = true;
InBlock.gif            
this.textBoxBackScroue.Size = new System.Drawing.Size(16821);
InBlock.gif            
this.textBoxBackScroue.TabIndex = 1;
InBlock.gif            
this.textBoxBackScroue.Text = "E:\\工作区\\物资\\永安物流";
InBlock.gif            
// 
InBlock.gif            
// label1
InBlock.gif            
// 
InBlock.gif
            this.label1.Location = new System.Drawing.Point(08);
InBlock.gif            
this.label1.Name = "label1";
InBlock.gif            
this.label1.Size = new System.Drawing.Size(4832);
InBlock.gif            
this.label1.TabIndex = 2;
InBlock.gif            
this.label1.Text = "要备份目录:";
InBlock.gif            
// 
InBlock.gif            
// button1
InBlock.gif            
// 
InBlock.gif
            this.button1.Location = new System.Drawing.Point(2328);
InBlock.gif            
this.button1.Name = "button1";
InBlock.gif            
this.button1.Size = new System.Drawing.Size(4823);
InBlock.gif            
this.button1.TabIndex = 3;
InBlock.gif            
this.button1.Text = "选择";
InBlock.gif            
this.button1.Click += new System.EventHandler(this.button1_Click);
InBlock.gif            
// 
InBlock.gif            
// label2
InBlock.gif            
// 
InBlock.gif
            this.label2.Location = new System.Drawing.Point(048);
InBlock.gif            
this.label2.Name = "label2";
InBlock.gif            
this.label2.Size = new System.Drawing.Size(4840);
InBlock.gif            
this.label2.TabIndex = 4;
InBlock.gif            
this.label2.Text = "备份位置:";
InBlock.gif            
// 
InBlock.gif            
// textBoxBackTrigger
InBlock.gif            
// 
InBlock.gif
            this.textBoxBackTrigger.Location = new System.Drawing.Point(5656);
InBlock.gif            
this.textBoxBackTrigger.Name = "textBoxBackTrigger";
InBlock.gif            
this.textBoxBackTrigger.ReadOnly = true;
InBlock.gif            
this.textBoxBackTrigger.Size = new System.Drawing.Size(16821);
InBlock.gif            
this.textBoxBackTrigger.TabIndex = 5;
InBlock.gif            
this.textBoxBackTrigger.Text = "D:\\备份";
InBlock.gif            
// 
InBlock.gif            
// button2
InBlock.gif            
// 
InBlock.gif
            this.button2.Location = new System.Drawing.Point(23256);
InBlock.gif            
this.button2.Name = "button2";
InBlock.gif            
this.button2.Size = new System.Drawing.Size(4823);
InBlock.gif            
this.button2.TabIndex = 6;
InBlock.gif            
this.button2.Text = "选择";
InBlock.gif            
this.button2.Click += new System.EventHandler(this.button2_Click);
InBlock.gif            
// 
InBlock.gif            
// labelFile
InBlock.gif            
// 
InBlock.gif
            this.labelFile.Location = new System.Drawing.Point(8136);
InBlock.gif            
this.labelFile.Name = "labelFile";
InBlock.gif            
this.labelFile.Size = new System.Drawing.Size(27240);
InBlock.gif            
this.labelFile.TabIndex = 7;
InBlock.gif            
// 
InBlock.gif            
// labelDir
InBlock.gif            
// 
InBlock.gif
            this.labelDir.Location = new System.Drawing.Point(8184);
InBlock.gif            
this.labelDir.Name = "labelDir";
InBlock.gif            
this.labelDir.Size = new System.Drawing.Size(27240);
InBlock.gif            
this.labelDir.TabIndex = 8;
InBlock.gif            
// 
InBlock.gif            
// progressBar1
InBlock.gif            
// 
InBlock.gif
            this.progressBar1.Dock = System.Windows.Forms.DockStyle.Bottom;
InBlock.gif            
this.progressBar1.Location = new System.Drawing.Point(0262);
InBlock.gif            
this.progressBar1.Name = "progressBar1";
InBlock.gif            
this.progressBar1.Size = new System.Drawing.Size(28823);
InBlock.gif            
this.progressBar1.TabIndex = 9;
InBlock.gif            
// 
InBlock.gif            
// labelFileSize
InBlock.gif            
// 
InBlock.gif
            this.labelFileSize.Location = new System.Drawing.Point(8232);
InBlock.gif            
this.labelFileSize.Name = "labelFileSize";
InBlock.gif            
this.labelFileSize.Size = new System.Drawing.Size(12823);
InBlock.gif            
this.labelFileSize.TabIndex = 10;
InBlock.gif            
// 
InBlock.gif            
// labelFileCopying
InBlock.gif            
// 
InBlock.gif
            this.labelFileCopying.Location = new System.Drawing.Point(168232);
InBlock.gif            
this.labelFileCopying.Name = "labelFileCopying";
InBlock.gif            
this.labelFileCopying.Size = new System.Drawing.Size(10423);
InBlock.gif            
this.labelFileCopying.TabIndex = 11;
InBlock.gif            
// 
InBlock.gif            
// Form1
InBlock.gif            
// 
InBlock.gif
            this.AutoScaleBaseSize = new System.Drawing.Size(614);
InBlock.gif            
this.ClientSize = new System.Drawing.Size(288285);
InBlock.gif            
this.Controls.Add(this.labelFileCopying);
InBlock.gif            
this.Controls.Add(this.labelFileSize);
InBlock.gif            
this.Controls.Add(this.progressBar1);
InBlock.gif            
this.Controls.Add(this.labelDir);
InBlock.gif            
this.Controls.Add(this.labelFile);
InBlock.gif            
this.Controls.Add(this.button2);
InBlock.gif            
this.Controls.Add(this.textBoxBackTrigger);
InBlock.gif            
this.Controls.Add(this.label2);
InBlock.gif            
this.Controls.Add(this.button1);
InBlock.gif            
this.Controls.Add(this.textBoxBackScroue);
InBlock.gif            
this.Controls.Add(this.label1);
InBlock.gif            
this.Controls.Add(this.ok);
InBlock.gif            
this.Name = "Form1";
InBlock.gif            
this.Text = "文件拷贝";
InBlock.gif            
this.ResumeLayout(false);
InBlock.gif
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif        
#endregion

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 应用程序的主入口点。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        [STAThread]
InBlock.gif        
static void Main() 
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            Application.Run(
new Form1());
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 拷贝文件
InBlock.gif        
/// </summary>
ExpandedSubBlockEnd.gif        
/// <param name="stringFile"></param>

InBlock.gif        private void FileCopy(string stringFile,string stringDirTigger)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
string[] strFiles;
InBlock.gif            
string[] strDirs;
InBlock.gif            
string strDirTigger =stringDirTigger;
InBlock.gif            
string strDirName ="";
InBlock.gif            
// 建立当然目录
InBlock.gif
            if(Directory.Exists( stringFile))
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                strFiles 
= Directory.GetFiles(stringFile);
InBlock.gif                
foreach(string strFile in strFiles)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    strDirName 
= strFile.Substring(stringFile.Length +1);
InBlock.gif                    strDirTigger 
= stringDirTigger + "\\" + strDirName ;
InBlock.gif                    
InBlock.gif                    FileCopy(strFile,strDirTigger);
ExpandedSubBlockEnd.gif                }

InBlock.gif
InBlock.gif                strDirs 
= Directory.GetDirectories(stringFile);
InBlock.gif                
foreach(string strFile in strDirs)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    strDirName 
= strFile.Substring(stringFile.Length +1);
InBlock.gif                    strDirTigger 
= stringDirTigger + "\\" +  strDirName ;
InBlock.gif                    Directory.CreateDirectory(strDirTigger);
InBlock.gif                    FileCopy(strFile, strDirTigger);
ExpandedSubBlockEnd.gif                }

InBlock.gif
ExpandedSubBlockEnd.gif            }

InBlock.gif            
else if(File.Exists(stringFile))
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
InBlock.gif                labelDir.Text 
= "从 " + alDir[intCopy].ToString() + " 到 "+ alDir[intCopy].ToString() ;
InBlock.gif                labelFile.Text 
= "正在复制  " + alFile[intCopy].ToString();
InBlock.gif                File.Copy(stringFile,stringDirTigger);
InBlock.gif
InBlock.gif                FileInfo fi 
= new FileInfo(stringFile);
InBlock.gif                longFileCopyindSize 
+= fi.Length;
InBlock.gif                labelFileCopying.Text 
= "已经复制 " + GetFileSize(longFileCopyindSize);
InBlock.gif
InBlock.gif                
//progressBar1.Step =1;
InBlock.gif
                progressBar1.Value = ++intCopy;
InBlock.gif                
InBlock.gif
ExpandedSubBlockEnd.gif            }

InBlock.gif
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 获得文件名称
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="stringFile"></param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        private string GetFileName(string stringFile)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
return stringFile.Substring(stringFile.LastIndexOf("\\"+ 1);
InBlock.gif
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 获得目录名称
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="stringFile"></param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        private string GetDirName(string stringFile)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
string stringDir;
InBlock.gif
InBlock.gif            stringDir 
= stringFile.Substring(0,stringFile.LastIndexOf("\\"));
InBlock.gif            stringDir 
= stringDir.Substring(stringDir.LastIndexOf("\\"+ 1);
InBlock.gif            
return stringDir;
InBlock.gif
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 获得目录的大小及文件列表
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="stringFile"></param>
ExpandedSubBlockEnd.gif        
/// <param name="stringDirTigger"></param>

InBlock.gif        private void FileCopyStat(string stringFile,string stringDirTigger)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
string[] strFiles;
InBlock.gif            
string[] strDirs;
InBlock.gif            
string strDirTigger =stringDirTigger;
InBlock.gif            
string strDirName ="";
InBlock.gif            
string stringParmFile ="";
InBlock.gif            
string stringParmDir = "";
InBlock.gif            
// 建立当前目录
InBlock.gif
            if(Directory.Exists( stringFile))
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                strFiles 
= Directory.GetFiles(stringFile);
InBlock.gif                
foreach(string strFile in strFiles)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    strDirName 
= strFile.Substring(stringFile.Length +1);
InBlock.gif                    strDirTigger 
= stringDirTigger + "\\" + strDirName ;
InBlock.gif                    
InBlock.gif                    FileCopyStat(strFile,strDirTigger);
ExpandedSubBlockEnd.gif                }

InBlock.gif
InBlock.gif                strDirs 
= Directory.GetDirectories(stringFile);
InBlock.gif                
foreach(string strFile in strDirs)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    strDirName 
= strFile.Substring(stringFile.Length +1);
InBlock.gif                    strDirTigger 
= stringDirTigger + "\\" +  strDirName ;
InBlock.gif                    FileCopyStat(strFile, strDirTigger);
ExpandedSubBlockEnd.gif                }

InBlock.gif
ExpandedSubBlockEnd.gif            }

InBlock.gif            
else if(File.Exists(stringFile))
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                stringParmFile 
= GetFileName(stringFile);
InBlock.gif                alFile.Add(stringParmFile);
InBlock.gif                stringParmDir 
= GetDirName(stringFile);
InBlock.gif                FileInfo fi 
= new FileInfo(stringFile);
InBlock.gif                longFileSize 
+= fi.Length;
InBlock.gif                labelFileSize.Text 
= GetFileSize(longFileSize);
InBlock.gif    
InBlock.gif                alDir.Add(stringParmDir);
InBlock.gif                intParm
++;
InBlock.gif
ExpandedSubBlockEnd.gif            }

InBlock.gif
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 转换文件大小
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="longFileSize"></param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        private string GetFileSize(long longFileSize)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
long longK = 1024;
InBlock.gif            
long longM = 1024*1024;
InBlock.gif            
long longFileSizeReturn;
InBlock.gif            
string stringFileSize="";
InBlock.gif            longFileSizeReturn 
= longFileSize / longM ;
InBlock.gif            
if(longFileSizeReturn >= 1)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                stringFileSize 
=longFileSizeReturn.ToString() + "M";
ExpandedSubBlockEnd.gif            }

InBlock.gif            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                longFileSizeReturn 
= longFileSize / longK ;
InBlock.gif                stringFileSize 
=longFileSizeReturn.ToString() + "K";
InBlock.gif
ExpandedSubBlockEnd.gif            }

InBlock.gif            
return stringFileSize;
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 设置初始
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private void setInit()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            intCopy 
= 0;
InBlock.gif            intParm 
= 0;
InBlock.gif            progressBar1.Value 
=intCopy;
InBlock.gif            alDir.Clear();
InBlock.gif            alFile.Clear();
InBlock.gif            labelDir.Text 
= "";
InBlock.gif            labelFile.Text 
= "";
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 复制文件
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private void CopyFiles()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
string stringDirMain;
InBlock.gif            
string strDirTrigger;
InBlock.gif            
string strDirTime = System.DateTime.Now.ToString("yyyyMMddHHmmss");
InBlock.gif
InBlock.gif            stringDirMain 
= textBoxBackScroue.Text;
InBlock.gif            stringDirMain 
= stringDirMain.Substring(stringDirMain.LastIndexOf("\\"));
InBlock.gif            strDirTrigger 
= textBoxBackTrigger.Text + "\\" + strDirTime;
InBlock.gif            Directory.CreateDirectory(strDirTrigger);
InBlock.gif            strDirTrigger 
+= "\\" + stringDirMain;
InBlock.gif            
// 创建备份时间目录
InBlock.gif
            Directory.CreateDirectory(strDirTrigger);
InBlock.gif
InBlock.gif            
// 读取文件大小设置
InBlock.gif
            FileCopyStat(textBoxBackScroue.Text, strDirTrigger);
InBlock.gif            progressBar1.Maximum 
= intParm;
InBlock.gif            
// 复制文件到目标目录
InBlock.gif
            FileCopy(textBoxBackScroue.Text, strDirTrigger);
InBlock.gif            
// 设置原始状态
InBlock.gif
            setInit();
InBlock.gif            Application.Exit();
InBlock.gif
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
private void button1_Click(object sender, System.EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
if(DialogResult.OK==folderBrowserDialog1.ShowDialog())
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                textBoxBackScroue.Text 
= folderBrowserDialog1.SelectedPath;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
private void ok_Click(object sender, System.EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
// 以线程方式处理文件
InBlock.gif
            System.Threading.Thread th =new System.Threading.Thread(new System.Threading.ThreadStart(CopyFiles));
InBlock.gif            th.Start();
InBlock.gif
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
private void button2_Click(object sender, System.EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
if(DialogResult.OK==folderBrowserDialog1.ShowDialog())
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                textBoxBackTrigger.Text 
= folderBrowserDialog1.SelectedPath;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
InBlock.gif        
InBlock.gif        
ExpandedSubBlockEnd.gif    }

ExpandedBlockEnd.gif}

None.gif

转载于:https://www.cnblogs.com/caolyf/archive/2005/04/15/138542.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值