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

  • Thread starter Nathan Sokalski
  • Start date
N

Nathan Sokalski

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?
 
M

Mark Rae [MVP]

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?

[X-posting removed]

Please show your code...
 
Z

zacks

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top