Wednesday, March 28, 2012

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

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?"Nathan Sokalski" <njsokalski@.hotmail.comwrote in message
news:ehSNlnJ8HHA.5164@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted 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
>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...

--
Mark Rae
ASP.NET MVP
http://www.markrae.net
On Sep 6, 11:23 am, "Nathan Sokalski" <njsokal...@.hotmail.comwrote:

Quote:

Originally Posted 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
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.

0 comments:

Post a Comment