Export (0) Print
Expand All

HttpListenerResponse.ContentLength64 Property

Gets or sets the number of bytes in the body data included in the response.

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

member ContentLength64 : int64 with get, set

Property Value

Type: System.Int64
The value of the response's Content-Length header.

ExceptionCondition
ArgumentOutOfRangeException

The value specified for a set operation is less than zero.

InvalidOperationException

The response is already being sent.

ObjectDisposedException

This object is closed.

The Content-Length header expresses the length, in bytes, of the response's body data. When using a format that is not send the data chunked or raw, you must set the ContentLength64 property. If you do not, the HttpListener does not send the response data.

For a complete list of response headers, see the HttpResponseHeader enumeration.

The following code example demonstrates setting the value of this property.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft