比较源和目标并删除特定的扩展文件,如.cs和.aspx页面 [英] comparing source and target and deleting specific extension files like .cs and .aspx page

查看:71
本文介绍了比较源和目标并删除特定的扩展文件,如.cs和.aspx页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我实现了类库,从源目录复制到目标目录(包含asp.net Web应用程序任务),包括子目录。



我的新要求是限制某些文件从源复制到目标(例如:.exe文件)并删除目标中不可用的文件。 />




例如:



复制前:

source- 1.txt,2.txt,3.exe,4.aspx

target-1.txt,6.txt 5.exe,7.aspx



复制后:

source- 1.txt,2.txt,3.exe,4.aspx

target-1.txt, 2.txt,4.aspx(3.exe限制复制,6.txt 5.exe,7.aspx必须删除)

Hi,

I was implemented the class library with copying from source directory to target directory (which contains asp.net web application tasks)including sub directories.

My new requirement is restrict some file to copy from source to target(eg:.exe files) and delete the files those are not available in my target.


Eg:

before copy:
source- 1.txt, 2.txt,3.exe,4.aspx
target-1.txt, 6.txt 5.exe, 7.aspx

after copy:
source- 1.txt, 2.txt,3.exe, 4.aspx
target-1.txt, 2.txt,4.aspx(3.exe restricted to copy, 6.txt 5.exe, 7.aspx have to delete)

推荐答案

而不是重新发明轮子,使用带有/ MIR参数的robocopy。
Instead of re-inventing the wheel, use robocopy with /MIR parameter.


使用超越比较 ......



http://www.scootersoftware.com/index.php [ ^ ]



它可以比较整个文件夹,显示丢失文件和文本差异ferences ...



我为此目的遇到过的最好的工具......
Use Beyond Compare...

http://www.scootersoftware.com/index.php[^]

It can compare entire folders, shows missing files and also textual differences...

The best tool i ever encountered for this purpose...


这篇关于比较源和目标并删除特定的扩展文件,如.cs和.aspx页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆