共用方式為


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 值。

適用於