corelibraries-devexpress-dot-security-dot-resources-228d4110.md
A rule that allows or denies access to a file directory.
Namespace : DevExpress.Security.Resources
Assembly : DevExpress.Data.v25.2.dll
NuGet Package : DevExpress.Data
public sealed class DirectoryAccessRule :
UriAccessRule
Public NotInheritable Class DirectoryAccessRule
Inherits UriAccessRule
The following members return DirectoryAccessRule objects:
Define a directory access rule to allow or deny resource load from all/specific file directories in your application. You can use the static Allow(String[]) or Deny(String[]) method to create directory access rules. Use the SetRules(IAccessRule[]) method to register these rules.
Examples :
// Image load from file directories is allowed
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Allow());
' Image load from file directories is allowed
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Allow())
// Image load from file directories is denied
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Deny());
' Image load from file directories is denied
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Deny())
// Image load is allowed only from the specified file directory
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Allow("C:\StaticResources\"));
' Image load is allowed only from the specified file directory
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Allow("C:\StaticResources\"))
// Image load from the specified file directories is denied
// images from other file directories are accessible
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Deny("C:\StaticResources\"));
' Image load from the specified file directory is denied
' Images from other directories are accessible
DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Deny("C:\StaticResources\"))
Object UriAccessRule DirectoryAccessRule
See Also