FileIOPermission.AllFiles 属性

定义

获取或设置对所有文件的允许访问权限。

public:
 property System::Security::Permissions::FileIOPermissionAccess AllFiles { System::Security::Permissions::FileIOPermissionAccess get(); void set(System::Security::Permissions::FileIOPermissionAccess value); };
public System.Security.Permissions.FileIOPermissionAccess AllFiles { get; set; }
member this.AllFiles : System.Security.Permissions.FileIOPermissionAccess with get, set
Public Property AllFiles As FileIOPermissionAccess

属性值

所有文件的文件 I/O 标志集合。

示例

下面的代码示例演示如何使用 AllFiles 属性。

FileIOPermission^ f3 = gcnew FileIOPermission( PermissionState::None );
f->AllFiles = FileIOPermissionAccess::Read;
try
{
    f3->Demand();
}
catch (SecurityException^ s)
{
    Console::WriteLine(s->Message);
}
FileIOPermission f3 = new FileIOPermission(PermissionState.None);
f3.AllFiles = FileIOPermissionAccess.Read;
try
{
    f3.Demand();
}
catch (SecurityException s)
{
    Console.WriteLine(s.Message);
}
Dim f3 As New FileIOPermission(PermissionState.None)
f3.AllFiles = FileIOPermissionAccess.Read
Try
    f3.Demand()
Catch s As SecurityException
    Console.WriteLine(s.Message)
End Try

注解

此属性获取或设置对本地计算机和网络驱动器上所有文件的允许访问。

可以使用按位 AND 运算检查单个 FileIOPermissionAccess 值。

适用于