Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7408177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:51:59+00:00 2026-05-29T05:51:59+00:00

So I followed MS article http://msdn.microsoft.com/en-us/library/ms171645.aspx This is Creating an Explorer Style Interface with

  • 0

So I followed MS article http://msdn.microsoft.com/en-us/library/ms171645.aspx

This is Creating an Explorer Style Interface with the ListView and TreeView Controls Using the Designer.

So all is well, howerver, is you set it to the root of C to scan all the folders and files etc. I receive {"Access to the path '<path to file' is denied."}

VS 2010 points this spot that is the issue.

subSubDirs = subDir.GetDirectories();

I can put a try catch around this are, howerver, after the exception is thrown the app doesn’t continue.

Is there a way I can skip directories that the app cannot access?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:51:59+00:00Added an answer on May 29, 2026 at 5:51 am

    You might have the try catch in the wrong place. Based on the code in the walkthrough you could put the try catch like this:

    Replace:

    subSubDirs = subDir.GetDirectories();
    

    with this:

    try 
    {
        subSubDirs = subDir.GetDirectories();
    }
    catch(UnauthorizedAccessException uae)
    {
      //log that subDir.GetDirectories was not possible
    }
    

    Also, the line:

    if (subSubDirs.Length != 0)
    

    should be changed to:

    if (subSubDirs != null && subSubDirs.Length != 0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I followed MS article http://msdn.microsoft.com/en-us/library/ms171645.aspx This is Creating an Explorer Style Interface with
I've followed the instructions in this MSDN article: http://msdn.microsoft.com/en-us/library/dd206945.aspx Is it possible to call
I followed this article http://www.codeproject.com/KB/sharepoint/ASPNET_to_Sharepoint.aspx and it worked converting my ASP.net Site into SharePoint
I have followed this tutorial http://blogs.wrox.com/article/creating-a-simple-ipad-application-table-view/ (creating a uitableview and populating it). I want
I followed the guide on the very bottom of this article: http://symfony.com/doc/current/cookbook/assetic/asset_management.html I have
http://www.devx.com/wireless/Article/39101/0/page/2 I have followed this tutorial and got it to work and everything. now
Some 4 years back, I followed this MSDN article for DateTime usage best practices
I have seen the following links before posting this question http://www.devx.com/wireless/Article/40792/1954 Saving Android Activity
I'm aggregating RSS feeds using FeedTools. I followed this tutorial: http://simonwoodside.com/weblog/2008/12/7/ruby_on_rails_feedrss_aggregator/ and everything functioned
If I need to go from this service contract: [ServiceContract(Namespace=http://api.x.com/Svc1)] public interface IService1 {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.