When combining patterns in string representation, they should be separated by vertical bar (|).
In a pattern, you can use these wildcards:
Some pattern examples:
public sealed class FileTypeSet : HashSet<string>
Public NotInheritable Class FileTypeSet
Inherits HashSet(Of String)
Setting access control file types in code:
//allow only *.jpg and *.gif
accessControl.AllowedFileTypes = "*.jpg|*.gif";
//or
accessControl.AllowedFileTypes = FileTypeSet.Parse("*.jpg|*.gif");
//or
accessControl.AllowedFileTypes = new FileTypeSet
{
"*.jpg",
"*.gif"
};
//allow all except *.exe and *.dll
accessControl.DeniedFileTypes = "*.exe|*.dll";
//or
accessControl.DeniedFileTypes = FileTypeSet.Parse("*.exe|*.dll");
//or
accessControl.DeniedFileTypes = new FileTypeSet
{
"*.exe",
"*.dll"
};
'allow only *.jpg and *.gif
accessControl.AllowedFileTypes = "*.jpg|*.gif"
'or
accessControl.AllowedFileTypes = FileTypeSet.Parse("*.jpg|*.gif")
'or
accessControl.AllowedFileTypes = New FileTypeSet() From {
"*.jpg",
"*.gif"
}
'allow all except *.exe and *.dll
accessControl.DeniedFileTypes = "*.exe|*.dll"
'or
accessControl.DeniedFileTypes = FileTypeSet.Parse("*.exe|*.dll")
'or
accessControl.DeniedFileTypes = New FileTypeSet() From {
"*.exe",
"*.dll"
}
Setting access control file types in ASPX markup:
<%-- allow only *.jpg and *.gif --%>
<GleamTech:FileManagerAccessControl
Path="\"
AllowedPermissions="Full"
AllowedFileTypes="*.jpg|*.gif" />
<%-- allow all except *.exe and *.dll --%>
<GleamTech:FileManagerAccessControl
Path="\"
AllowedPermissions="Full"
DeniedFileTypes="*.exe|*.dll" />
FileTypeSet | Initializes a new instance of the FileTypeSet class. |
FileTypeSet(IEnumerableString) | Initializes a new instance of the FileTypeSet class. |
Comparer | Gets the IEqualityComparerT object that is used to determine equality for the values in the set. (Inherited from HashSetString) |
Count | Gets the number of elements that are contained in a set. (Inherited from HashSetString) |
Add | Adds the specified element to a set. (Inherited from HashSetString) |
Clear | Removes all elements from a HashSetT object. (Inherited from HashSetString) |
Contains | Determines whether a HashSetT object contains the specified element. (Inherited from HashSetString) |
CopyTo(T) | Copies the elements of a HashSetT object to an array. (Inherited from HashSetString) |
CopyTo(T, Int32) | Copies the elements of a HashSetT object to an array, starting at the specified array index. (Inherited from HashSetString) |
CopyTo(T, Int32, Int32) | Copies the specified number of elements of a HashSetT object to an array, starting at the specified array index. (Inherited from HashSetString) |
ExceptWith | Removes all elements in the specified collection from the current HashSetT object. (Inherited from HashSetString) |
GetEnumerator | Returns an enumerator that iterates through a HashSetT object. (Inherited from HashSetString) |
GetObjectData | Implements the ISerializable interface and returns the data needed to serialize a HashSetT object. (Inherited from HashSetString) |
IntersectWith | Modifies the current HashSetT object to contain only elements that are present in that object and in the specified collection. (Inherited from HashSetString) |
IsProperSubsetOf | Determines whether a HashSetT object is a proper subset of the specified collection. (Inherited from HashSetString) |
IsProperSupersetOf | Determines whether a HashSetT object is a proper superset of the specified collection. (Inherited from HashSetString) |
IsSubsetOf | Determines whether a HashSetT object is a subset of the specified collection. (Inherited from HashSetString) |
IsSupersetOf | Determines whether a HashSetT object is a superset of the specified collection. (Inherited from HashSetString) |
OnDeserialization | Implements the ISerializable interface and raises the deserialization event when the deserialization is complete. (Inherited from HashSetString) |
Overlaps | Determines whether the current HashSetT object and a specified collection share common elements. (Inherited from HashSetString) |
Parse | Converts the string representation of a set of file patterns to its FileTypeSet equivalent. |
Remove | Removes the specified element from a HashSetT object. (Inherited from HashSetString) |
RemoveWhere | Removes all elements that match the conditions defined by the specified predicate from a HashSetT collection. (Inherited from HashSetString) |
SetEquals | Determines whether a HashSetT object and the specified collection contain the same elements. (Inherited from HashSetString) |
SymmetricExceptWith | Modifies the current HashSetT object to contain only elements that are present either in that object or in the specified collection, but not both. (Inherited from HashSetString) |
ToRegex | Converts the current set of file patterns to its Regex equivalent. |
ToString | Converts the current set of file patterns to a string representation with default separator '|'. (Overrides ObjectToString) |
ToString(String) | Converts the current set of file patterns to a string representation with a custom separator. |
TrimExcess | Sets the capacity of a HashSetT object to the actual number of elements it contains, rounded up to a nearby, implementation-specific value. (Inherited from HashSetString) |
TryGetValue | Searches the set for a given value and returns the equal value it finds, if any. (Inherited from HashSetString) |
UnionWith | Modifies the current HashSetT object to contain all elements that are present in itself, the specified collection, or both. (Inherited from HashSetString) |
(String to FileTypeSet) | Converts the string representation of a set of file patterns to its FileTypeSet equivalent. |