FileWebRequest.ContentLength FileWebRequest.ContentLength FileWebRequest.ContentLength FileWebRequest.ContentLength Property

Definition

Ruft die Länge des Inhalts der gesendeten Daten ab, oder legt diese fest.Gets or sets the content length of the data being sent.

public:
 virtual property long ContentLength { long get(); void set(long value); };
public override long ContentLength { get; set; }
member this.ContentLength : int64 with get, set
Public Overrides Property ContentLength As Long

Eigenschaftswert

Die Anzahl der Bytes der gesendeten Anforderungsdaten.The number of bytes of request data being sent.

Ausnahmen

Beispiele

Im folgenden Codebeispiel wird die Länge des Inhalts der gesendeten Daten festgelegt.The following code example sets the content length of the data being sent. Lesen Sie das gesamte Beispiel in der FileWebRequest -Klasse.Refer to the complete example in the FileWebRequest class.

// Set the ContentLength property.
myFileWebRequest->ContentLength = byteArray->Length;
String^ contentLength = myFileWebRequest->ContentLength.ToString();
Console::WriteLine( "\nThe content length is {0}.", contentLength );

// Set the ContentLength property.
myFileWebRequest.ContentLength = byteArray.Length;

string contentLength = myFileWebRequest.ContentLength.ToString ();

Console.WriteLine ("\nThe content length is {0}.", contentLength);

' Set the ContentLength property.
myFileWebRequest.ContentLength = byteArray.Length

Dim contentLength As String = myFileWebRequest.ContentLength.ToString()

Console.WriteLine(ControlChars.Lf + "The content length is {0}.", contentLength)

Gilt für: