IsolatedStorageScope Enum

Definisi

Menghitung tingkat cakupan penyimpanan terisolasi yang didukung oleh IsolatedStorage.

Enumerasi ini mendukung kombinasi bitwise dari nilai yang termasuk di dalamnya.

public enum class IsolatedStorageScope
[System.Flags]
public enum IsolatedStorageScope
[System.Flags]
[System.Serializable]
public enum IsolatedStorageScope
[System.Flags]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum IsolatedStorageScope
[<System.Flags>]
type IsolatedStorageScope = 
[<System.Flags>]
[<System.Serializable>]
type IsolatedStorageScope = 
[<System.Flags>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type IsolatedStorageScope = 
Public Enum IsolatedStorageScope
Warisan
IsolatedStorageScope
Atribut

Bidang

Application 32

Penyimpanan terisolasi yang terisolasi ke aplikasi.

Assembly 4

Penyimpanan terisolasi yang tercakup dalam identitas perakitan.

Domain 2

Penyimpanan terisolasi yang terlingkup ke identitas domain aplikasi.

Machine 16

Penyimpanan terisolasi yang terlingkup ke komputer.

None 0

Tidak ada penggunaan penyimpanan yang terisolasi.

Roaming 8

Penyimpanan terisolasi dapat ditempatkan di lokasi pada sistem file yang mungkin menjelajah (jika data pengguna roaming diaktifkan pada sistem operasi yang mendasar).

User 1

Penyimpanan terisolasi yang dilingkup oleh identitas pengguna.

Contoh

Contoh kode berikut menunjukkan bagaimana IsolatedStorageScope enumerasi digunakan dalam GetStore metode .

// Retrieve an IsolatedStorageFile for the current Domain and Assembly.
IsolatedStorageFile^ isoFile = IsolatedStorageFile::GetStore( static_cast<IsolatedStorageScope>(IsolatedStorageScope::User | IsolatedStorageScope::Assembly | IsolatedStorageScope::Domain), (Type^)nullptr, nullptr );
IsolatedStorageFileStream^ isoStream = gcnew IsolatedStorageFileStream( this->userName,FileMode::Open,FileAccess::ReadWrite,isoFile );

// Retrieve an IsolatedStorageFile for the current Domain and Assembly.
IsolatedStorageFile isoFile =
    IsolatedStorageFile.GetStore(IsolatedStorageScope.User |
    IsolatedStorageScope.Assembly |
    IsolatedStorageScope.Domain,
    null,
    null);

IsolatedStorageFileStream isoStream =
    new IsolatedStorageFileStream("substituteUsername",
    System.IO.FileMode.Open,
    System.IO.FileAccess.Read,
     System.IO.FileShare.Read);
' Retrieve an IsolatedStorageFile for the current Domain and Assembly.
Dim isoFile As IsolatedStorageFile = _
    IsolatedStorageFile.GetStore(IsolatedStorageScope.User _
    Or IsolatedStorageScope.Assembly _
    Or IsolatedStorageScope.Domain, Nothing, Nothing)

Dim isoStream As New IsolatedStorageFileStream("substituteUsername", System.IO.FileMode.Open, _
    System.IO.FileAccess.Read, System.IO.FileShare.Read)

Keterangan

Gunakan IsolatedStorageScope untuk menentukan tingkat cakupan untuk penyimpanan yang terisolasi. Anda dapat menentukan kombinasi tingkat ini yang didukung oleh IsolatedStorage.

Berlaku untuk

Lihat juga