473,324 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() are not returning the specified directory

I have an ASP.NET application which displays the directories & files in a
specified directory on the server. I use the
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() to
retrieve the lists of files and directories. I have two very similar
versions of this that I am debugging, both of which use the methods
mentioned above. However, one of them is returning the contents of the
specified directory and the other is returning the contents of the project's
directory. I have checked to see what values are used by and returned by
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles(), and
they use the values I expect, but do not return the directories and files in
that directory. What is going on here?

Sep 6 '07 #1
1 2786
On Sep 6, 11:23 am, "Nathan Sokalski" <njsokal...@hotmail.comwrote:
I have an ASP.NET application which displays the directories & files in a
specified directory on the server. I use the
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() to
retrieve the lists of files and directories. I have two very similar
versions of this that I am debugging, both of which use the methods
mentioned above. However, one of them is returning the contents of the
specified directory and the other is returning the contents of the project's
directory. I have checked to see what values are used by and returned by
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles(), and
they use the values I expect, but do not return the directories and files in
that directory. What is going on here?
Both of those methods work fine for me. You will need to post some
actual code that is having the problem.

Sep 6 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Earl Teigrob | last post by:
Does someone have or know of an algorythm (method) that will delete all files under a give directory and its subdirectories based on a wildcard mask? I can use this for one directory for each...
4
by: Elmo Watson | last post by:
Is there a way, with the System.IO class, to do a recursive list of a directory structure? For instance, in DirectoryInfo, you have GetDirectories and GetFiles .... In Directory, you have...
1
by: Trint Smith | last post by:
I can get file names with the following code... Dim di As New DirectoryInfo("c:\OrderData\Database") Dim fiArr As FileInfo() = di.GetFiles() Dim f As FileInfo For Each f In fiArr Dim...
0
by: dim mzeura via .NET 247 | last post by:
(Type your message here) -------------------------------- From: dim mzeura I have the same problem too. Please help! System.Data.OleDb.OleDbException: Syntax error (missing operator) in...
3
by: cjb | last post by:
Is there a way to get Directory.GetFiles to return multi-language file names? I haven't found any overloads that allow any such parameter. The way I am using it now is: foreach (string d in...
8
by: Anthony P. | last post by:
Hello Everyone, I am building an application and I need to walk the file system from the root directory on down. I need to cover every single directory on the system and all of their sub...
2
by: Nathan Sokalski | last post by:
I have an ASP.NET application which displays the directories & files in a specified directory on the server. I use the System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() to...
3
by: Nathan Sokalski | last post by:
I am getting the list of subdirectories from a specified directory using System.IO.Directory.GetDirectories(), and would like to get only subdirectories that are not hidden or system directories. I...
3
by: Michael Jackson | last post by:
In my .NET 2.0 VS 2005 VB application, I'm using Directory.GetFiles(path) to get all the files in the directory. However, I'm getting an error regarding "Illegal character in Path", even though I...
3
by: =?Utf-8?B?RGF2aWRN?= | last post by:
Hi, does anyone know if I can scan a subdirectory using wildcards? I do not see a way to do this using: string folder = @"C:\INPUT\CUSTOMERS\ID???BC.*" DirectoryInfo di = new...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.