ContextUtil.IsSecurityEnabled 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 keamanan berbasis peran aktif dalam konteks saat ini.
public:
static property bool IsSecurityEnabled { bool get(); };
public static bool IsSecurityEnabled { get; }
static member IsSecurityEnabled : bool
Public Shared ReadOnly Property IsSecurityEnabled As Boolean
Nilai Properti
true
jika konteks saat ini mengaktifkan keamanan; jika tidak, false
.
Pengecualian
Tidak tersedia konteks COM+.
Contoh
Contoh kode berikut mendapatkan nilai IsSecurityEnabled properti .
[SecurityRole("Role1")]
public ref class ContextUtil_IsSecurityEnabled: public ServicedComponent
{
public:
void Example()
{
// Display whether role-based security is active for the current COM+
// context.
Console::WriteLine( "Role-based security active in current context: {0}",
ContextUtil::IsSecurityEnabled );
}
};
[SecurityRole("Role1")]
public class ContextUtil_IsSecurityEnabled : ServicedComponent
{
public void Example()
{
// Display whether role-based security is active for the current COM+
// context.
Console.WriteLine("Role-based security active in current context: {0}",
ContextUtil.IsSecurityEnabled);
}
}
<SecurityRole("Role1")> _
Public Class ContextUtil_IsSecurityEnabled
Inherits ServicedComponent
Public Sub Example()
' Display whether role-based security is active for the current COM+
' context.
MsgBox("Role-based security active in current context: " & ContextUtil.IsSecurityEnabled)
End Sub
End Class
Berlaku untuk
Berkolaborasi dengan kami di GitHub
Sumber untuk konten ini dapat ditemukan di GitHub, yang juga dapat Anda gunakan untuk membuat dan meninjau masalah dan menarik permintaan. Untuk informasi selengkapnya, lihat panduan kontributor kami.