HttpContentHeaderCollection.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 value of the HTTP Content-Length header on the HTTP content.
public:
property IReference<unsigned long long> ^ ContentLength { IReference<unsigned long long> ^ get(); void set(IReference<unsigned long long> ^ value); };
IReference<uint64_t> ContentLength();
void ContentLength(IReference<uint64_t> value);
public System.Nullable<ulong> ContentLength { get; set; }
var iReference = httpContentHeaderCollection.contentLength;
httpContentHeaderCollection.contentLength = iReference;
Public Property ContentLength As Nullable(Of ULong)
Property Value
The value of the HTTP Content-Length header value on the HTTP content. A null value means that the header is absent.
Remarks
The following sample code shows a method to get or set the Content-Length header on HTTP content using the ContentLength property on the HttpContentHeaderCollection object.
// Content-Length header
// nullable ulong
void DemoContentLength(IHttpContent content) {
var h = content.Headers;
h.ContentLength = 313;
var header = h.ContentLength;
uiLog.Text += "\nCONTENT LENGTH HEADER\n";
uiLog.Text += string.Format("ContentLength: ToString: {0}\n\n", header.ToString());
}
Applies to
Váš názor
https://aka.ms/ContentUserFeedback.
Připravujeme: V průběhu roku 2024 budeme postupně vyřazovat problémy z GitHub coby mechanismus zpětné vazby pro obsah a nahrazovat ho novým systémem zpětné vazby. Další informace naleznete v tématu:Odeslat a zobrazit názory pro