RSS Forums RSS
Please support our C# advertiser: Programming Forums

Quick directory question

Join Date: Jul 2005
Location: FL.
Posts: 1,536
Reputation: tayspen is on a distinguished road 
Rep Power: 7
Solved Threads: 98
Colleague
tayspen's Avatar
tayspen tayspen is offline Offline
<Insert title here>

Quick directory question

  #1  
Sep 11th, 2005
how would i coppy only specific things out of a directory. say *.mp3. I am able to copy the whold directory but i only want specific endings.

this is part of the copy code
 try
            {
                Directory.CreateDirectory(targerDirectoryName);

                string[] files = Directory.GetFiles(sourceDirectoryName);

                foreach (string fileName in files)
                    File.Copy(fileName, targerDirectoryName + Path.DirectorySeparatorChar + Path.GetFileName(fileName));

                string[] directories = Directory.GetDirectories(sourceDirectoryName);

                foreach (string directory in directories)
                    CopyDirectory(directory, targerDirectoryName + Path.DirectorySeparatorChar + Path.GetFileName(directory));
            }

            catch
            {
                //
            }

if you no how i can specify wha i want to copy that be great.
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes

Member - Alliance of Security Analysis Professionals - Since 2006
AddThis Social Bookmark Button
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 4:24 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC