如何在VB.NET 2008中移动多个文件 [英] How to Move Multiple Files in VB.NET 2008

查看:94
本文介绍了如何在VB.NET 2008中移动多个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VB.NET 2008- Win.App.

我有一个文件夹名称:ExpData
在此文件夹中,我有多个扩展名为* .xml的文件.

十一月,我要选择所有文件并移动
到另一个文件夹.名称= BkpExp

任何帮助将不胜感激.

在此先感谢.

VB.NET 2008- Win.App.

I Have a Folder Name : ExpData
in this folder i have a multiple files with *.xml extension.

Nov i want to select this all files and move
to another folder. name = BkpExp

Any Help will be highly appreciated.

Thanks in Advance.

推荐答案

亲爱的朋友,

首先,您可以通过以下方式获取目标文件夹中带有扩展名的文件数:-

Dear Friend,

First you can get the number of files with the extension in the target folder by this:-

string[] files = directory.GetFiles(@"c:\windows\system32", "*.xml", SearchOption.AllDirectories);
return files.Length;



有关更多详细信息,请单击此链接:- http://msdn.microsoft.com/zh-cn/library /ms143316.aspx [ ^ ]

然后通过循环遍历files数组中的文件数,您可以找到一个xml文件,并可以使用以下代码将该文件移动到目标文件夹:-

http://msdn.microsoft.com/en-us/library/cc148994.aspx [ ^ ]


希望对您有所帮助.

谢谢



For more details please follow this link:- http://msdn.microsoft.com/en-us/library/ms143316.aspx[^]

and then by looping on the number of files in the files array you can find the xml file one by one and can move the file to target folder with this code:-

http://msdn.microsoft.com/en-us/library/cc148994.aspx[^]


I hope this will help you out.

Thanks


这篇关于如何在VB.NET 2008中移动多个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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