共用方式為


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

適用於