FileIOPermission.AllLocalFiles 属性

定义

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

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

属性值

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

示例

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

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

注解

本地文件是包含在本地计算机上的文件。 无法通过网络驱动器访问的任何文件都是本地文件。

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

适用于