AuthenticatedStream.IsEncrypted 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得 Boolean 值,指示使用這個 AuthenticatedStream 傳送的資料是否加密。
public:
abstract property bool IsEncrypted { bool get(); };
public abstract bool IsEncrypted { get; }
member this.IsEncrypted : bool
Public MustOverride ReadOnly Property IsEncrypted As Boolean
屬性值
如果在經由網路傳輸資料前對其進行加密,並在到達遠端端點時將其解密,則為 true
,否則為 false
。
範例
下列範例示範如何顯示這個屬性的值。
// The following class displays the properties of an authenticatedStream.
public ref class AuthenticatedStreamReporter
{
public:
static void DisplayProperties( AuthenticatedStream^ stream )
{
Console::WriteLine( L"IsAuthenticated: {0}", stream->IsAuthenticated );
Console::WriteLine( L"IsMutuallyAuthenticated: {0}", stream->IsMutuallyAuthenticated );
Console::WriteLine( L"IsEncrypted: {0}", stream->IsEncrypted );
Console::WriteLine( L"IsSigned: {0}", stream->IsSigned );
Console::WriteLine( L"IsServer: {0}", stream->IsServer );
}
};
// 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
備註
加密有助於保護數據的隱私權;也就是說,它有助於確保數據在傳輸中時,無法由第三方譯碼。