NegotiateStream.IsAuthenticated 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會得到 Boolean 一個值,表示認證是否成功。
public:
virtual property bool IsAuthenticated { bool get(); };
public override bool IsAuthenticated { get; }
member this.IsAuthenticated : bool
Public Overrides ReadOnly Property IsAuthenticated As Boolean
屬性值
true若成功認證;否則,。 false
範例
以下程式碼範例展示了此屬性的值。
static void DisplayAuthenticationProperties(NegotiateStream stream)
{
Console.WriteLine("IsAuthenticated: {0}", stream.IsAuthenticated);
Console.WriteLine("IsMutuallyAuthenticated: {0}", stream.IsMutuallyAuthenticated);
Console.WriteLine("IsEncrypted: {0}", stream.IsEncrypted);
Console.WriteLine("IsSigned: {0}", stream.IsSigned);
Console.WriteLine("ImpersonationLevel: {0}", stream.ImpersonationLevel);
Console.WriteLine("IsServer: {0}", stream.IsServer);
}
備註
用戶端透過呼叫 AuthenticateAsClient OR BeginAuthenticateAsClient 方法來進行驗證。 伺服器透過呼叫 AuthenticateAsServer OR BeginAuthenticateAsServer 方法來進行認證。