Bagikan melalui


FileIOPermission.AllLocalFiles Properti

Definisi

Mendapatkan atau mengatur akses yang diizinkan ke semua file lokal.

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

Nilai Properti

Kumpulan bendera I/O file untuk semua file lokal.

Contoh

Contoh kode berikut menunjukkan penggunaan AllLocalFiles properti .

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

Keterangan

File lokal adalah file yang terkandung di komputer lokal. File apa pun yang tidak diakses melalui drive jaringan adalah file lokal.

Nilai individual FileIOPermissionAccess dapat diperiksa untuk menggunakan operasi AND bitwise.

Berlaku untuk