ProfilePropertySettings.ReadOnly Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan atau menetapkan nilai yang menentukan apakah properti terkait di kelas yang dihasilkan ProfileCommon secara dinamis bersifat baca-saja.
public:
property bool ReadOnly { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("readOnly", DefaultValue=false)]
public bool ReadOnly { get; set; }
[<System.Configuration.ConfigurationProperty("readOnly", DefaultValue=false)>]
member this.ReadOnly : bool with get, set
Public Property ReadOnly As Boolean
Nilai Properti
true jika properti terkait di ProfileCommon kelas bersifat baca-saja; jika tidak, false. Defaultnya adalah false.
- Atribut
Contoh
Contoh kode berikut menunjukkan cara menggunakan ReadOnly properti . Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk ProfileSection kelas .
// Get the current ReadOnly property value.
Console.WriteLine(
"Current ReadOnly value: '{0}'", profilePropertySettings.ReadOnly);
// Set the ReadOnly property to true.
profilePropertySettings.ReadOnly = true;
' Get the current ReadOnly property value.
Console.WriteLine( _
"Current ReadOnly value: '{0}'", profilePropertySettings.ReadOnly)
' Set the ReadOnly property to true.
profilePropertySettings.ReadOnly = true
Keterangan
Pada waktu proses, sistem kompilasi ASP.NET menggunakan informasi yang ditentukan di profile bagian file konfigurasi untuk menghasilkan kelas yang disebut ProfileCommon, yang berasal dari ProfileBase. Kelas ini memungkinkan Anda mengakses dan memodifikasi nilai untuk profil pengguna individual.
Definisi ProfileCommon kelas didasarkan pada properti yang ditentukan dalam properties subbagian profile bagian file konfigurasi. Nilai properti yang Anda tentukan untuk instans ProfilePropertySettings kelas akan digunakan untuk menentukan properti terkait di ProfileCommon kelas .