Bagikan melalui


FileWebRequest.ContentLength Properti

Definisi

Mendapatkan atau mengatur panjang konten data yang dikirim.

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

Nilai Properti

Jumlah byte data permintaan yang dikirim.

Pengecualian

Contoh

Contoh kode berikut mengatur panjang konten data yang dikirim. Lihat contoh lengkap di FileWebRequest kelas .

// 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)

Berlaku untuk