Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Directory.GetDirectories(path) causing security issue

Directory.GetDirectories(path) causing security issue

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-netsecurity
7 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SIJUTHOMASP
    wrote on last edited by
    #1

    Hi When I tried to search files using the code given below Dim f() As String = Directory.GetDirectories(path) it is generating an error like "Error : Request for the permission of type System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed." I am getting the issue even if I specify the folders which is having full access. I am using asp.net using vb.net in my program. Please show me the right way to solve this.It is much appreciating.. Thank You, RPM. :(( :((

    S 1 Reply Last reply
    0
    • S SIJUTHOMASP

      Hi When I tried to search files using the code given below Dim f() As String = Directory.GetDirectories(path) it is generating an error like "Error : Request for the permission of type System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed." I am getting the issue even if I specify the folders which is having full access. I am using asp.net using vb.net in my program. Please show me the right way to solve this.It is much appreciating.. Thank You, RPM. :(( :((

      S Offline
      S Offline
      Sandeep Akhare
      wrote on last edited by
      #2

      Are you trying to search system folder ? if you only want to get files from the folder try this code DirectoryInfo di = new DirectoryInfo(path); FileInfo[] fi= di.GetFiles();

      S 1 Reply Last reply
      0
      • S Sandeep Akhare

        Are you trying to search system folder ? if you only want to get files from the folder try this code DirectoryInfo di = new DirectoryInfo(path); FileInfo[] fi= di.GetFiles();

        S Offline
        S Offline
        SIJUTHOMASP
        wrote on last edited by
        #3

        Hi Sandeep, Thank much for the quick response and information..I tried that but still I am getting the same error..It is going to catch while executing the "DirectoryInfo" code,where we are getting the directory.. How I can resolve this...? Thanks, RPM..:confused::confused:

        SoftwareDeveloper(.NET)

        S 1 Reply Last reply
        0
        • S SIJUTHOMASP

          Hi Sandeep, Thank much for the quick response and information..I tried that but still I am getting the same error..It is going to catch while executing the "DirectoryInfo" code,where we are getting the directory.. How I can resolve this...? Thanks, RPM..:confused::confused:

          SoftwareDeveloper(.NET)

          S Offline
          S Offline
          Sandeep Akhare
          wrote on last edited by
          #4

          Are you trying to search system folder ? or any internet tool folder or your own local folder reply

          S 1 Reply Last reply
          0
          • S Sandeep Akhare

            Are you trying to search system folder ? or any internet tool folder or your own local folder reply

            S Offline
            S Offline
            SIJUTHOMASP
            wrote on last edited by
            #5

            In my search I am trying to search only my own local folders and some folders are in network.. For example //Myserver/users/fname Thanks, RPM.

            SoftwareDeveloper(.NET)

            S 1 Reply Last reply
            0
            • S SIJUTHOMASP

              In my search I am trying to search only my own local folders and some folders are in network.. For example //Myserver/users/fname Thanks, RPM.

              SoftwareDeveloper(.NET)

              S Offline
              S Offline
              Sandeep Akhare
              wrote on last edited by
              #6

              OK i think problem is the security of the folder do one thing first try to search your local folder such as C:/foldername ok and be sure that you can access this folder from asp.net application to check this try out following 1) reight click the folder go to properties then click the security tab 2)In group or usernames see the following names are added or not ASP.NET Machine Account[userid\ASPNET] also check Debugger Users[debugger\Debugger Users] if they are not present then you have to add them by clicking add button

              S 1 Reply Last reply
              0
              • S Sandeep Akhare

                OK i think problem is the security of the folder do one thing first try to search your local folder such as C:/foldername ok and be sure that you can access this folder from asp.net application to check this try out following 1) reight click the folder go to properties then click the security tab 2)In group or usernames see the following names are added or not ASP.NET Machine Account[userid\ASPNET] also check Debugger Users[debugger\Debugger Users] if they are not present then you have to add them by clicking add button

                S Offline
                S Offline
                SIJUTHOMASP
                wrote on last edited by
                #7

                Hi Sandeep, Thanks a lot for your responses... I followed the steps,but when I tried to add the specified groups,I couldn't find them in the drop down..... What I should do... Thanks, RPM.

                SoftwareDeveloper(.NET)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups