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.

適用於