Results 1 to 2 of 2

Thread: Filtering on protected operating folders?

  1. #1

    Thread Starter
    Addicted Member SkyCoder's Avatar
    Join Date
    Oct 2003
    Location
    Moon Crater 25
    Posts
    183

    Filtering on protected operating folders?

    Code:
     Dim MyRoot As New System.IO.DirectoryInfo("C:\")
            For Each MyDirInfo As System.IO.DirectoryInfo In _
            MyRoot.GetDirectories("*", IO.SearchOption.TopDirectoryOnly)
             
                MessageBox.Show(MyDirInfo.FullName)
               
              
            Next
    I have a simple procedure looping thru files on a specific root/drive. I want to filter on system folders that are not accessable. i cant seem to find an attribute that relates to that?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Filtering on protected operating folders?

    Just handle the exception that gets thrown and move on.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width