This documentation is archived and is not being maintained.

FileCodeGroup Class

Grants permission to manipulate files located in the code assemblies to code assemblies that match the membership condition. This class cannot be inherited.

For a list of all members of this type, see FileCodeGroup Members.

System.Object
   System.Security.Policy.CodeGroup
      System.Security.Policy.FileCodeGroup

[Visual Basic]
<Serializable>
NotInheritable Public Class FileCodeGroup
   Inherits CodeGroup
[C#]
[Serializable]
public sealed class FileCodeGroup : CodeGroup
[C++]
[Serializable]
public __gc __sealed class FileCodeGroup : public CodeGroup
[JScript]
public
   Serializable
class FileCodeGroup extends CodeGroup

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

Code groups are the building blocks of code access security policy. Each policy level consists of a root code group that can have child code groups. Each child code group can have their own child code groups; this behavior extends to any number of levels, forming a tree. Each code group has a membership condition that determines if a given assembly belongs to it based on the evidence for that assembly. Only code groups whose membership conditions match a given assembly and their child code groups apply policy.

FileCodeGroup has the same child matching semantics as UnionCodeGroup. However, FileCodeGroup returns a permission set containing a dynamically-calculated FileIOPermission that grants file access to the directory from which the code is run; UnionCodeGroup only returns a static permission set. The type of file access granted is passed as a parameter to the constructor.

This code group only matches assemblies run over a file protocol, that is, assemblies that have URLs that point to a file or UNC path.

Requirements

Namespace: System.Security.Policy

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Mscorlib (in Mscorlib.dll)

See Also

FileCodeGroup Members | System.Security.Policy Namespace | Code Groups

Show: