Click here to Skip to main content
15,916,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

1 solution

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;


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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900