FileIOPermission.AllFiles FileIOPermission.AllFiles FileIOPermission.AllFiles FileIOPermission.AllFiles Property

定義

取得或設定允許的所有檔案存取。Gets or sets the permitted access to all files.

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 旗標集合。The set of file I/O flags for all files.

範例

下列程式碼範例示範使用AllFiles屬性。The following code example shows the use of the AllFiles property.

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

備註

此屬性會取得或設定在本機電腦和網路磁碟機上的所有檔案的存取。This property gets or sets the permitted access to all files on the local computer and network drives.

個人FileIOPermissionAccess值可以檢查是否有使用位元的 AND 運算。An individual FileIOPermissionAccess value can be checked for using a bitwise AND operation.

適用於