system.io.directory Questions

22

Solved

What is the syntax for setting multiple file-extensions as searchPattern on Directory.GetFiles()? For example filtering out files with .aspx and .ascx extensions. // TODO: Set the string 'searchPa...
Roots asked 12/8, 2011 at 11:42

3

Solved

I've read discussions about difference between Directory.EnumerateFiles and Directory.GetFiles. I understand that internally they both use System.IO.FileSystemEnumerableFactory.CreateFileNameItera...
Photocell asked 10/4, 2015 at 7:31

4

Solved

I need a simple function which will take a FileInfo and a destination_directory_name as input, get the file path from the fileinfo and replicate it in the destination_directory_name passed as the s...
Dowable asked 13/1, 2009 at 8:27

3

Solved

I'm trying to create a remote directory, and then write a file to it. Every great once in a while, the application fails with a System.IO.DirectoryNotFoundException while trying to write the file. ...
Sidneysidoma asked 8/2, 2010 at 23:9

4

I recently bumped into a weird functionality from Microsoft: Let's assume our folder c:\tmp123 contains 3 files - 1.txt 2.txtx 3.txtxt a) Invocation of Directory.GetFiles(@"C:\tmp123", "*.txt") y...
Gangplank asked 10/1, 2012 at 8:49

3

I am not sure why we would use Directory.GetFiles for if Directory.EnumerateFiles would be able to do the same thing and you would be able to enumerate the list even before the whole list of direct...
Elenoraelenore asked 4/7, 2014 at 2:49

2

I use in a C# program System.IO.Directory.GetFiles(dirname, "*.*", System.IO.SearchOption.AllDirectories).Length; to count to number of files in a directory(and its subdirectories) on a share. I ...
Brunella asked 19/7, 2011 at 12:50

2

Solved

I am writing an application that updates some drivers. However the drivers are "in use" and can't be deleted unless I restart my computer. So how can I write an application to delete these locked ...
Shikari asked 24/5, 2010 at 14:2

4

Solved

Why can't I create a class in VB.NET that inherits System.IO.Directory? According to Lutz Roeder, it is not declared as NotInheritable! I want to create a utility class that adds functionality to ...
Loop asked 25/9, 2008 at 20:17
1

© 2022 - 2024 — McMap. All rights reserved.