引入X组件
大石头 authored at 2016-11-21 15:26:33
605.00 B
GitCandy
// 自动选择最新的文件源
var srcs = new String[] { @"..\Bin", @"C:\X\DLL", @"C:\X\Bin", @"E:\X\DLL", @"E:\X\Bin" };
var cur = ".".GetFullPath();
foreach (var item in srcs)
{
    // 跳过当前目录
    if (item.EqualIgnoreCase(cur)) continue;

    Console.WriteLine("复制 {0} => {1}", item, cur);

    try
    {
        item.AsDirectory().CopyToIfNewer(cur, "*.dll;*.exe;*.xml;*.pdb;*.cs", false,
            name => Console.WriteLine("\t{1}\t{0}", name, item.CombinePath(name).AsFile().LastWriteTime.ToFullString()));
    }
    catch (Exception ex) { Console.WriteLine(" " + ex.Message); }
}