Query a Network Share Directory

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?aGVjc2FuMDc=?=

    #1

    Query a Network Share Directory

    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
    AccessDeniedExc eption. I know there has to be a better way of doing this
    using Impersonation.
    Can someone please help?

    Hector
  • DArnold

    #2
    Re: Query a Network Share Directory

    hecsan07 wrote:
    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
    AccessDeniedExc eption. I know there has to be a better way of doing this
    using Impersonation.
    Can someone please help?
    >
    AccessDeniedExc eption 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.

    Comment

    Working...