WindowsIdentity.IsGuest 屬性

定義

取得值,指出使用者帳戶是否由系統識別為 Guest 帳戶。

public:
 virtual property bool IsGuest { bool get(); };
public virtual bool IsGuest { get; }
member this.IsGuest : bool
Public Overridable ReadOnly Property IsGuest As Boolean

屬性值

如果使用者帳戶是 Guest 帳戶,則為 true;否則為 false

範例

下列程式碼示範如何使用 IsGuest 屬性傳回值,指出使用者帳戶是否由系統識別為 Guest 帳戶。 此程式碼範例是提供給 類別之較大範例的 WindowsIdentity 一部分。

if ( windowsIdentity->IsGuest )
{
   propertyDescription = String::Concat( propertyDescription, ", is a Guest account" );
}
if (windowsIdentity.IsGuest)
{
    propertyDescription += ", is a Guest account";
}
If (windowsIdentity.IsGuest) Then
    propertyDescription += ", is a Guest account"
End If

適用於