SectionInformation.IsProtected 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 nilai yang menunjukkan apakah bagian konfigurasi terkait dilindungi.
public:
property bool IsProtected { bool get(); };
public bool IsProtected { get; }
member this.IsProtected : bool
Public ReadOnly Property IsProtected As Boolean
Nilai Properti
true
jika ini ConfigurationSection dilindungi; jika tidak, false
. Default adalah false
.
Contoh
Contoh di bagian ini menunjukkan cara mendapatkan IsProtected nilai properti setelah mengakses informasi bagian terkait dalam file konfigurasi.
Contoh berikut mendapatkan SectionInformation objek .
// Get the current configuration file.
System.Configuration.Configuration config =
ConfigurationManager.OpenExeConfiguration(
ConfigurationUserLevel.None);
// Get the section.
UrlsSection section =
(UrlsSection)config.GetSection("MyUrls");
SectionInformation sInfo =
section.SectionInformation;
' Get the current configuration file.
Dim config _
As System.Configuration.Configuration = _
ConfigurationManager.OpenExeConfiguration( _
ConfigurationUserLevel.None)
' Get the section.
Dim section As UrlsSection = _
CType(config.GetSection("MyUrls"), UrlsSection)
Dim sInfo As SectionInformation = _
section.SectionInformation
Contoh berikut mendapatkan nilainya IsProtected .
bool protect =
sInfo.IsProtected;
Console.WriteLine("Section protected?: {0}",
protect.ToString());
Dim protect As Boolean = _
sInfo.IsProtected
Console.WriteLine("Section protected?: {0}", _
protect.ToString())
Keterangan
Bagian konfigurasi yang dilindungi dienkripsi dan baca-saja.
Untuk informasi selengkapnya tentang bagian konfigurasi yang dilindungi, lihat Mengenkripsi Informasi Konfigurasi Menggunakan Konfigurasi Terproteksi.
Berlaku untuk
Lihat juga
Saran dan Komentar
https://aka.ms/ContentUserFeedback.
Segera hadir: Sepanjang tahun 2024 kami akan menghentikan penggunaan GitHub Issues sebagai mekanisme umpan balik untuk konten dan menggantinya dengan sistem umpan balik baru. Untuk mengetahui informasi selengkapnya, lihat:Kirim dan lihat umpan balik untuk