共用方式為


HttpRequest.TotalBytes 屬性

定義

取得目前輸入資料流的位元組數目。

public:
 property int TotalBytes { int get(); };
public int TotalBytes { get; }
member this.TotalBytes : int
Public ReadOnly Property TotalBytes As Integer

屬性值

Int32

在輸入資料流的位元組數目。

範例

下列程式碼範例會判斷屬性值是否 TotalBytes 大於 1000 個位元組,並將該資訊寫入檔案。

// Write a message to the file dependent upon
// the value of the TotalBytes property.
if (Request.TotalBytes > 1000)
{
    sw.WriteLine("The request is 1KB or greater");
}
else
{
    sw.WriteLine("The request is less than 1KB");
}
' Write a message to the file dependent upon
' the value of the TotalBytes property.
If Request.TotalBytes > 1000 Then
    sw.WriteLine("The request is 1KB or greater")
Else
    sw.WriteLine("The request is less than 1KB")
End If

適用於