ServicePoint.ClientCertificate 屬性

定義

取得傳送到伺服器的最後一個用戶端憑證。

C#
public System.Security.Cryptography.X509Certificates.X509Certificate? ClientCertificate { get; }
C#
public System.Security.Cryptography.X509Certificates.X509Certificate ClientCertificate { get; }

屬性值

X509Certificate 物件,包含傳送到伺服器之最後用戶端憑證的公用值。

範例

下列程式代碼範例會顯示此屬性的值。

C#
if (sp.Certificate == null)
    Console.WriteLine("Certificate = (null)");
else
    Console.WriteLine("Certificate = " + sp.Certificate.ToString());

if (sp.ClientCertificate == null)
    Console.WriteLine("ClientCertificate = (null)");
else
    Console. WriteLine("ClientCertificate = " + sp.ClientCertificate.ToString());

Console.WriteLine("ProtocolVersion = " + sp.ProtocolVersion.ToString());
Console.WriteLine("SupportsPipelining = " + sp.SupportsPipelining);

適用於

產品 版本
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1