C#如何备份文件夹

[复制链接]
查看11 | 回复2 | 2011-7-15 13:46:14 | 显示全部楼层 |阅读模式
把A文件夹的内容,备份到D:\test 下面。
同时记录开始、结束时间,文件大小。
希望能高手能提供具体代码。谢谢

回复

使用道具 举报

千问 | 2011-7-15 13:46:14 | 显示全部楼层
private void Form1_Load(object sender, EventArgs e)
{
string path1 = @"D:\A\";
string path2 = @"D:\B\";
Stopwatch watch = new Stopwatch();
watch.Start();//开始测量
if (Directory.Exists(path1) && Directory.Exists(path2))//检查路径(目录)是否存在
{
st...
回复

使用道具 举报

千问 | 2011-7-15 13:46:14 | 显示全部楼层
using system.iofile.copy()file.delte()...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行