Mono Class Library: System.Net.WebRequest Overview | Members

System.Net.WebRequest.ContentLength Property

Gets or sets the content length of the request data being sent. [Edit]

public virtual long ContentLength { set; get; }

Value

A long containing the number of bytes of request data being sent. [Edit]

Exceptions

TypeReason
NotSupportedExceptionThis property is not implemented in the derived class. [Edit]
InvalidOperationExceptionData has already been written to the request stream. [Edit]
ArgumentOutOfRangeExceptionThis property is being set to a value less than zero. [Edit]

Remarks

Operation
This property is required to throw a InvalidOperationException exception if data has already been written to the request stream, and a ArgumentOutOfRangeException exception if the property is being set to a value less than zero.

This property throws NotSupportedException.

Note to Inheritors
This property is required to be overridden by classes that inherit from System.Net.WebRequest.

Usage
Use this property to get the number of bytes sent to the resource.

[Edit]

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0