directoryinfo Questions

5

Solved

My goal is to check, if DirectoryInfo.FullName is one of the special folders. Here is what I'm doing for this (Check directoryInfo.FullName to each special folder if they are equal): DirectoryIn...
Switch asked 20/8, 2011 at 11:3

3

I have an exception in the third line ofthis code "Second path fragment must not be a drive or UNC name" DirectoryInfo labdi = new DirectoryInfo(Back.mainfolderpath + @"\news\l"); DirectoryInfo tl...
Monies asked 3/9, 2013 at 16:4

4

Solved

I have a program that renames files or folders to lower case names. I have written this code: private void Replace(string FolderLocation, string lastText, string NewText) { if (lastText == "") ...
Bridge asked 16/11, 2011 at 13:52

4

Solved

I am following this tutorial from MSDN. There's something I saw in the code that I can't understand private void PopulateTreeView() { TreeNode rootNode; DirectoryInfo info = new DirectoryInf...
Jennefer asked 22/2, 2012 at 4:52

5

Solved

I have a directory with 2 files: file1.xls file2.xlsx If I do: directoryInfo.EnumerateFiles("*.xls", SearchOption.TopDirectoryOnly) It is returning both files, and I only want the first (fil...
Nuri asked 30/5, 2012 at 7:56

5

Solved

I try to work with DirectoryInfo, FileInfo with very long path. I try use \\?\c:\long path (i got illegal caracter with fileInfo and DirectoryInfo) I try use file://c:/long path (i got uri not su...
Daubery asked 8/9, 2009 at 13:23

4

I'm using a simple DirectoryInfo to grab all directories on the root on the C drive. However, I'm running under administrator and i'm getting the error of path access denied, below is the code that...
Nerissanerita asked 9/6, 2012 at 19:23

3

Solved

I'm trying to return the .config files that exist in %WINDIR%\System32\inetsrv\config. For this I am using the following code: DirectoryInfo configFolder = new DirectoryInfo(Environment.ExpandEnv...
Medicate asked 28/2, 2012 at 16:8

4

Solved

I am using DirectoryInfo.GetDirectories() recursively to find the all the sub-directories under a given path. However, I want to exclude the System folders and there is no clear way for that. In Fi...
Overtrump asked 19/9, 2008 at 9:26

2

Solved

Basics: C# WinForms desktop application targeting Dot Net 4. I am enumerating all drives on a system using System.IO.DriveInfo. This works quite well and can also tell me what type of drive it is ...
Reimport asked 25/2, 2014 at 13:42

2

I have one issue which is in fact solved, but I totally do not understand why it behaves like this. So I have a network share and I would like simply to verify if I have access to create new files...
Ruscio asked 7/2, 2014 at 9:0

1

Solved

This one sounds duplicate, but all the solutions given is not satisfying one of the requirement that is sorting by name. for instance J A1 J A2 J A3 J A10 J A11 The method returns J A1,J A...
Charitacharitable asked 13/1, 2014 at 4:49

1

I found this code that gets an array of files out of a DirectoryInfo : FileInfo[] fileInfoArray = di.EnumerateFiles().Where(f => extensions.Contains(f.Extension.ToLower())).ToArray(); But it ...
Bucher asked 27/11, 2013 at 22:2

2

Writing some code in C#, I was wondering if there was a way to get the correct path of a directoryinfo object? Currently I have, for example, a directory such as: DirectoryInfo dirInfo = new Dire...
Alfrediaalfredo asked 19/11, 2013 at 17:48

4

Assuming I have a folder structure like: C:\MyTemp - MySubFolder If I try to delete this using: Dim path As String = "C:\MyTemp" Dim di As System.IO.DirectoryInfo di = System.IO.Directory.Creat...
Scholl asked 5/11, 2010 at 0:29

5

Solved

When I recursive through some folders and files, I encounter this error: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and th...
Lease asked 6/3, 2012 at 12:52

1

Solved

I have a .NET application that I am trying to debug and part of my application loads a file from my project. This file is located at C:\Users\USER_FOLDER\Documents\Visual Studio 2012\Projects\MY_P...
Shriver asked 8/11, 2012 at 18:20

2

Solved

I previously asked the question Get all files and directories in specific path fast in order to find files as fastest as possible. I am using that solution in order to find the file names that matc...
Infestation asked 12/9, 2012 at 0:44

2

Solved

Possible Duplicate: .NET - Check if directory is accessible without exception handling Im making a small file explorer in Visual Studio 2010 with NET 3.5 and C#, and I have this funct...
Idiocy asked 29/7, 2012 at 14:7

2

Solved

This might be a confusing question but I have written below a Directory crawler, that will start at a root crawler, find all unique directories and then find all files and count them and add up the...
Logographic asked 28/3, 2012 at 18:14

2

If I want to instantiate a DirectoryInfo object with an UNC path DirectoryInfo myDI = new DirectoryInfo (@"\\server\share"); how can I pass a username / password that is required to access that...
Kovrov asked 5/8, 2009 at 9:26

4

Solved

Why when i give the path "c:" it changed me directly to application folder? static void Main(string[] args) { DirectoryInfo dir = new DirectoryInfo("c:"); Console.WriteLine(dir.FullName); Con...
Valiancy asked 3/2, 2012 at 14:39

1

Solved

I have a little bit of logic at the boundary of my app dealing with creating directories. I would like to test that it actually creates directories as expected, but the DirectoryInfo.Exists propert...
Alveraalverez asked 30/11, 2011 at 19:7

1

When I use DirectoryInfo with a specific path (say @"C:\") in my ASP.NET MVC application, it returns ok but when I try to use the exactly same path in my external C# library, it throws the above ex...
Ragi asked 18/4, 2011 at 15:30

4

Solved

Possible Duplicate: How to check whether 2 DirectoryInfo objects are pointing to the same directory? var dirUserSelected = new DirectoryInfo(Path.GetDirectoryName("SOME PATH")); var d...
Nolde asked 1/7, 2010 at 4:9

© 2022 - 2024 — McMap. All rights reserved.