比较两个文件夹

编程入门 行业动态 更新时间:2024-10-27 16:23:22
本文介绍了比较两个文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

你好, 我已经设置了一个按钮以及所有内容,我只需要知道如何为它设置代码即可在两个文件夹之间进行检查即可. 当我只单击按钮时,它将访问文件夹而不显示和比较它们. 完成后,我需要在Folder2中删除在Folder1中找不到的文件,但是在删除它们之前,我需要它保存每个文件名,然后再删除,以便可以从ZIP 2中删除它.

Hello, I have already setted up a button and everything, i just need to know how to setup a code for it to check between two folders.. that when i just click the button, it will access the folders without showing and compare them. when its done, i need the files that werent found in Folder1 to be deleted in Folder2, but before deleting them I need it to save every files name before it deletes so it can be deleted from a ZIP two.

推荐答案

您可以使用 System.IO.Directory.GetFiles,请参阅: msdn.microsoft/en-us/library/system.io. directory.aspx [^ ]. 要使用ZIP,您可以使用#ziplib: www.icsharpcode/opensource/sharpziplib/ [ ^ ]. 另一个选择是使用SevenZipSharp,它是著名的7-Zip的.NET包装: en.wikipedia/wiki/7-Zip [ ^ ], sevenzipsharp.codeplex/ [ ^ ]. 这两个ZIP库都是开源的.
—SA
You can use System.IO.Directory.GetFiles, please see: msdn.microsoft/en-us/library/system.io.directory.aspx[^]. For working with ZIP, you can use #ziplib: www.icsharpcode/opensource/sharpziplib/[^]. Another option is using SevenZipSharp, a .NET wrapper of the famous 7-Zip: en.wikipedia/wiki/7-Zip[^], sevenzipsharp.codeplex/[^]. Both ZIP libraries are open-source.
—SA

更多推荐

比较两个文件夹

本文发布于:2023-10-22 09:16:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1517091.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件夹   两个

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!