Export (0) Print
Expand All

ServicePoint.ProtocolVersion Property

Gets the version of the HTTP protocol that the ServicePoint object uses.

Namespace: System.Net
Assembly: System (in system.dll)

public virtual Version ProtocolVersion { get; }
/** @property */
public Version get_ProtocolVersion ()

public function get ProtocolVersion () : Version

Not applicable.

Property Value

A Version object that contains the HTTP protocol version that the ServicePoint object uses.

The HTTP protocol versions are HTTP/1.0 and HTTP/1.1.

The following code example displays the value of this property.

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);


if (sp.get_Certificate() == null) {
    Console.WriteLine("Certificate = (null)");
}
else {
    Console.WriteLine(("Certificate = " 
        + sp.get_Certificate().ToString()));
}

if (sp.get_ClientCertificate() == null) {
    Console.WriteLine("ClientCertificate = (null)");
}
else {
    Console.WriteLine(("ClientCertificate = " 
        + sp.get_ClientCertificate().ToString()));
}
Console.WriteLine(("ProtocolVersion = " 
    + sp.get_ProtocolVersion().ToString()));
Console.WriteLine(("SupportsPipelining = " 
    + sp.get_SupportsPipelining()));

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft