Export (0) Print
Expand All

ServicePoint.ProtocolVersion Property

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

[Visual Basic]
Public Overridable ReadOnly Property ProtocolVersion As Version
[C#]
public virtual Version ProtocolVersion {get;}
[C++]
public: __property virtual Version* get_ProtocolVersion();
[JScript]
public function get ProtocolVersion() : Version;

Property Value

A Version instance containing the HTTP protocol version that the ServicePoint uses.

Remarks

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

Example

[Visual Basic, C#, C++] The following example displays the value of this property.

[Visual Basic] 
If sp.Certificate Is Nothing Then
    Console.WriteLine("Certificate = (null)")
Else
    Console.WriteLine(("Certificate = " + sp.Certificate.ToString()))
End If

If sp.ClientCertificate Is Nothing Then
    Console.WriteLine("ClientCertificate = (null)")
Else
    Console.WriteLine(("ClientCertificate = " + sp.ClientCertificate.ToString()))
End If

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

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


[C++] 
if (sp->Certificate == 0)
    Console::WriteLine(S"Certificate = (null)");
else
    Console::WriteLine(S"Certificate = {0}", sp->Certificate);

if (sp->ClientCertificate == 0)
    Console::WriteLine(S"Client Certificate = (null)");
else
    Console::WriteLine(S"Client Certificate = {0}", sp->ClientCertificate);

Console::WriteLine(S"ProtocolVersion = {0}", sp->ProtocolVersion->ToString());
Console::WriteLine(S"SupportsPipelining = {0}", __box(sp->SupportsPipelining));

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

ServicePoint Class | ServicePoint Members | System.Net Namespace

Show:
© 2014 Microsoft