Query a Network Share Directory

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I am fairly new to .NET Development. I need to query folders within a
network drive and return some metadata related to the directories.
For instance, I might have the following path: \\MyServer\Tech
I would want to get the size and name of all the folders inside this folder.
I tried using a simple DirectoryInfo object, but I am getting
AccessDeniedException. I know there has to be a better way of doing this
using Impersonation.
Can someone please help?

Hector
 
hecsan07 said:
Hello

I am fairly new to .NET Development. I need to query folders within a
network drive and return some metadata related to the directories.
For instance, I might have the following path: \\MyServer\Tech
I would want to get the size and name of all the folders inside this folder.
I tried using a simple DirectoryInfo object, but I am getting
AccessDeniedException. I know there has to be a better way of doing this
using Impersonation.
Can someone please help?

AccessDeniedException means just that. You don't have permissions on the
Share with your user account to access anything on the Share If this
is a Web application and it's VS 2003, then the machine\ASPNET account
must have permissions to access the Share on the machine.

Keep in mind that access permission by user account to folders and files
on the Share is different than user account access permissions to the
Share itself.

You have a user account permissions issue that the application is
running under.
 
Back
Top