Directory FileSystemInfo file and folder permissions

From: Brian Watkins (raistlin19_at_aol.com)
Date: 11/19/03


Date: Wed, 19 Nov 2003 11:14:16 -0500

I am trying to loop through a directory and place all the folders and files
into an array. I want to store only the folders and files that the current
user has access to into the array. Below is some sample code of what I'm
doing:

Public Sub ProcessDirectory(byval strPath as string)
    Dim strRootFolder As String = Server.MapPath(strPath)
    Dim dir As New DirectoryInfo(strRootFolder)
    Dim fsi As FileSystemInfo
    For Each fsi In dir.GetFileSystemInfos()
        Try
            If TypeOf fsi Is FileInfo Then 'its a file
                PutFileintoArray(fsi)
            Else 'its a directory
                Dim d As DirectoryInfo = CType( fsi, DirectoryInfo )
                PutDirectoryintoArray(d.name)
                ProcessDirectory(strpath & d.name & "/")
            End If
        Catch

        End Try
    Next fsi

End Sub

When the above code runs it stores all the folders and files nicely into the
array but it is not using the permissions of the client user. It only adds
the folders and files that everyone has access to. I need to run the above
code with the client users windows permissions.

In IIS Directory Security, the Anonymous access is unchecked and Integrated
Windows Authentication is checked.
In the Web.config authentication mode="Windows".

Does anyone know what I'm doing wrong here?



Relevant Pages

  • Re: Nested Sets vs. Nested Intervals
    ... Since I like to use an array of folders, I would prefer to use the ... nested intervals if I use an array of folders in the URL. ... Counting all of the listings recursively in a subcat is anyway very ...
    (comp.databases.theory)
  • SyncToy versus Robocopy
    ... download) which synchronises two folders with an extraordinary degree of fine ... control, afforded by a huge array of command line options. ...
    (microsoft.public.windowsxp.photos)
  • Re: Parse a folder structure in PHP and MySQL
    ... /*if record is a child of the parent then add it to the select ... //then fetch each row as an associative array and store in a number ... I have a mysql table that defines the user folders for a website. ... New Books ...
    (php.general)
  • Re: Parse a folder structure in PHP and MySQL
    ... /*if record is a child of the parent then add it to the select ... //then fetch each row as an associative array and store in a number ... I have a mysql table that defines the user folders for a website. ... New Books ...
    (php.general)
  • Re: Public Folder Maint
    ... I have a question about the system public folders. ... The pf store on srv2 is missing system folders that are on srv1. ... I expect that the messages are hierarchy replication messages and not ...
    (microsoft.public.exchange.admin)