如何使用vb.net或c#将具有特定文件扩展名的文件从硬盘分区复制到特定位置? [英] How to copy files with specific file extension from a hard disk partition to specific location using vb.net or c#?

查看:92
本文介绍了如何使用vb.net或c#将具有特定文件扩展名的文件从硬盘分区复制到特定位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在当前项目中执行以下操作:

第一项任务:在分区中搜索具有特定文件扩展名的文件,即.jpg
第二项任务:然后在列表视图中填充所有文件(可选)
第三项任务:然后将所有文件复制到特定位置(文件夹)
第四项任务:然后使用密码将zip文件夹(可选)

http://www.codeproject.com/KB/files/filesearcher.aspx
在上面的链接的帮助下,我的第一个和第二个任务已经完成,但是我不知道如何执行第三个和第四个任务.

现在请帮助我,很紧急,我很着急...
在此先感谢...

I want to do following things in my current project:

1st task: search in a partition for files with specific file extension, i.e. .jpg
2nd task: then populate all files in listview (optional)
3rd task: then copy all files to specific location (folder)
4th task: then zip folder with a password (optional)

http://www.codeproject.com/KB/files/filesearcher.aspx
with the help of above link, my 1st and 2nd tasks are completed but i don''t know how to do 3rd and 4th task.

Please help me now, it is urgent, i am in hurry...
thanks in advance...

推荐答案

希望如何:复制,删除和移动文件和文件夹(C#编程指南) [ [
Hopefully How to: Copy, Delete, and Move Files and Folders (C# Programming Guide)[^] would give you enough information to copy files.

You can use the GZipStream class[^] to compress files.


这篇关于如何使用vb.net或c#将具有特定文件扩展名的文件从硬盘分区复制到特定位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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