View Single Post
  #2 (permalink)  
Old October 1st, 2010, 12:30 PM
ChristianNagel ChristianNagel is offline
Wrox Author
Points: 1,163, Level: 13
Points: 1,163, Level: 13 Points: 1,163, Level: 13 Points: 1,163, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2010
Location: Austria
Posts: 175
Thanks: 3
Thanked 53 Times in 53 Posts
Default

Where does the problem happen exactly? Accessing the directory within in the foreach loop? What file gives the problem? Did you catch the exception details?
With the my documents folder on my Windows 7 system I don't have a problem with hidden files.
Code:
            DirectoryInfo theFolder = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
            foreach (DirectoryInfo nextFolder in theFolder.GetDirectories())
            {
                Console.WriteLine(nextFolder.Name);
            }
__________________
Christian
CN innovation
Visit my blog at: csharp.christiannagel.com
Follow me on twitter: @christiannagel
The Following User Says Thank You to ChristianNagel For This Useful Post:
urbnsurfr (October 8th, 2010)