claudiov
08-04-2007, 09:51 AM
Hi all, I'm trying to enumerate files in a server directory and I receive a security exception error; I have opened a ticket: here below the thread.
If you have a solution to successfully enumerate a server directory please let me know ( I just need to fill a string array with directory's filenames).
Any help is appreciated.
Best regards.
Claudio
Here the ticket history thread:
Dear Customer,
</o:p>
The IUSR / ASPNET users already have change permission on your site.
</o:p>
The error you are seeing indicates that your application is trying to retrieve the permission on the file / directory which is not permitted.
</o:p>
Frank
</o:p>
DiscountASP.NET - Microsoft Gold Certified Partner
- asp.netPRO Magazine 2007 Readers' Choice Award for Best Hosting Service
- Visual Studio Magazine 2007 Readers' Choice Award for Best Hosting Service
</o:p>
On Fri, 03 Aug 2007 07:00:33 -0700, claudiov@microsoft.com wrote:
> I'm trying to enumerate the directory images but I'm receiving this error:
> Server Error in '/SlideShow' Application.
> --------------------------------------------------------------------------------
></o:p>
> Security Exception
> Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
></o:p>
> Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
></o:p>
> Source Error:
></o:p>
></o:p>
> Line 9: Dim myFileInfo As FileInfo
> Line 10: Dim i as integer
> Line 11: FileCollection = Directory.GetFiles("images", "*.png")
> Line 12: Dim MyFileList(FileCollection.Length) As String
> Line 13: For i = 0 To FileCollection.Length - 1
></o:p>
></o:p>
> Source File: E:\web\mshostingor\htdocs\slideshow\DefaultNew.asp x Line: 11
></o:p>
> It seems to me I need to set the ASPLocal user permission R/W on such directory but I casnnopt do it through the control panel...
></o:p>
> Could you please help me in finding a solution to this issue?...
If you have a solution to successfully enumerate a server directory please let me know ( I just need to fill a string array with directory's filenames).
Any help is appreciated.
Best regards.
Claudio
Here the ticket history thread:
Dear Customer,
</o:p>
The IUSR / ASPNET users already have change permission on your site.
</o:p>
The error you are seeing indicates that your application is trying to retrieve the permission on the file / directory which is not permitted.
</o:p>
Frank
</o:p>
DiscountASP.NET - Microsoft Gold Certified Partner
- asp.netPRO Magazine 2007 Readers' Choice Award for Best Hosting Service
- Visual Studio Magazine 2007 Readers' Choice Award for Best Hosting Service
</o:p>
On Fri, 03 Aug 2007 07:00:33 -0700, claudiov@microsoft.com wrote:
> I'm trying to enumerate the directory images but I'm receiving this error:
> Server Error in '/SlideShow' Application.
> --------------------------------------------------------------------------------
></o:p>
> Security Exception
> Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
></o:p>
> Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
></o:p>
> Source Error:
></o:p>
></o:p>
> Line 9: Dim myFileInfo As FileInfo
> Line 10: Dim i as integer
> Line 11: FileCollection = Directory.GetFiles("images", "*.png")
> Line 12: Dim MyFileList(FileCollection.Length) As String
> Line 13: For i = 0 To FileCollection.Length - 1
></o:p>
></o:p>
> Source File: E:\web\mshostingor\htdocs\slideshow\DefaultNew.asp x Line: 11
></o:p>
> It seems to me I need to set the ASPLocal user permission R/W on such directory but I casnnopt do it through the control panel...
></o:p>
> Could you please help me in finding a solution to this issue?...