AuthenticatedStream.IsServer 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得 Boolean 值,指示連接的本機端是否以伺服器身分驗證。
public:
abstract property bool IsServer { bool get(); };
public abstract bool IsServer { get; }
member this.IsServer : bool
Public MustOverride ReadOnly Property IsServer As Boolean
屬性值
如果本機端點以用戶端與伺服器經過驗證之連接的伺服器端身分驗證,則為 true;如果本機端點以用戶端身分驗證,則為 false。
範例
下列範例示範如何顯示這個屬性的值。
// The following class displays the properties of an authenticatedStream.
public class AuthenticatedStreamReporter
{
public static void DisplayProperties(AuthenticatedStream 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("IsServer: {0}", stream.IsServer);
}
}
' The following class displays the properties of an AuthenticatedStream.
Public Class AuthenticatedStreamReporter
Public Shared Sub DisplayProperties(stream As AuthenticatedStream)
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("IsServer: {0}", stream.IsServer)
End Sub
End Class
備註
大部分用於客戶端-伺服器驗證的安全性通訊協定會根據您是用戶端或伺服器,定義提供驗證認證的特定行為和需求。