FileWebRequest.ContentLength Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Property Value
The number of bytes of request data being sent.
Exceptions
ContentLength is less than 0.
Examples
The following code example sets the content length of the data being sent. 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)
Applies to
Surađujte s nama na GitHubu
Izvor za ovaj sadržaj možete pronaći na GitHubu, gdje možete stvarati i pregledavati probleme i zahtjeve za povlačenjem. Dodatne informacije potražite u našem vodiču za suradnike.