Directory.GetDirectories(path) causing security issue
-
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. :(( :(( -
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. :(( :((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();
-
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();
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)
-
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)
Are you trying to search system folder ? or any internet tool folder or your own local folder reply
-
Are you trying to search system folder ? or any internet tool folder or your own local folder reply
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)
-
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)
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
-
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
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)