.Net 2005 Directory.Getfiles() skipping system folders
.Net 2005 Directory.Getfiles() skipping system folders
.Net 2005 Directory.Getfiles() skipping system folders
.Net 2005 Directory.Getfiles() skipping system folders
.Net 2005 Directory.Getfiles() skipping system folders
.Net 2005 Directory.Getfiles() skipping system folders .Net 2005 Directory.Getfiles() skipping system folders .Net 2005 Directory.Getfiles() skipping system folders .Net 2005 Directory.Getfiles() skipping system folders .Net 2005 Directory.Getfiles() skipping system folders .Net 2005 Directory.Getfiles() skipping system folders .Net 2005 Directory.Getfiles() skipping system folders .Net 2005 Directory.Getfiles() skipping system folders
.Net 2005 Directory.Getfiles() skipping system folders .Net 2005 Directory.Getfiles() skipping system folders
.Net 2005 Directory.Getfiles() skipping system folders
Go Back  Xtreme Visual Basic Talk > > > .Net 2005 Directory.Getfiles() skipping system folders


Reply
 
Thread Tools Display Modes
  #1  
Old 11-03-2005, 01:45 PM
gravity7's Avatar
gravity7 gravity7 is offline
Regular
 
Join Date: May 2004
Location: Nashville, TN
Posts: 92
Default .Net 2005 Directory.Getfiles() skipping system folders


This is in reference to the post located:

Previous Post

I have been using a work around that checks the length of the directory name to search (i.e. > 3) so we don't look at root directories (i.e. "c:\"), but that seems like a bad work around. Can anyone offer any advice on the code that I am using to not search through system directories as to avoid the exception.

The code is posted as the last entry in the URL listed above.

Last edited by gravity7; 11-03-2005 at 01:45 PM. Reason: typo
Reply With Quote
  #2  
Old 11-03-2005, 01:53 PM
Volte's Avatar
Volte.Net 2005 Directory.Getfiles() skipping system folders Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,344
Default

You can use Directory.GetAttributes() to check the attributes of a directory to make sure it meets your criteria, and make sure that Directory.GetParent() is not a null reference to make sure you aren't in a root directory.
Reply With Quote
  #3  
Old 11-03-2005, 02:33 PM
gravity7's Avatar
gravity7 gravity7 is offline
Regular
 
Join Date: May 2004
Location: Nashville, TN
Posts: 92
Default

Quote:
Originally Posted by Volte
You can use Directory.GetAttributes() to check the attributes of a directory to make sure it meets your criteria, and make sure that Directory.GetParent() is not a null reference to make sure you aren't in a root directory.

The code I am using does check for the directory attributes just in the first 2 lines of the FOR statement. It seems like it is ignorning that code, but it does actually process that line of code....
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
.Net 2005 Directory.Getfiles() skipping system folders
.Net 2005 Directory.Getfiles() skipping system folders
.Net 2005 Directory.Getfiles() skipping system folders .Net 2005 Directory.Getfiles() skipping system folders
.Net 2005 Directory.Getfiles() skipping system folders
.Net 2005 Directory.Getfiles() skipping system folders
.Net 2005 Directory.Getfiles() skipping system folders .Net 2005 Directory.Getfiles() skipping system folders .Net 2005 Directory.Getfiles() skipping system folders .Net 2005 Directory.Getfiles() skipping system folders .Net 2005 Directory.Getfiles() skipping system folders .Net 2005 Directory.Getfiles() skipping system folders .Net 2005 Directory.Getfiles() skipping system folders
.Net 2005 Directory.Getfiles() skipping system folders
.Net 2005 Directory.Getfiles() skipping system folders
 
.Net 2005 Directory.Getfiles() skipping system folders
.Net 2005 Directory.Getfiles() skipping system folders
 
-->