共用方式為


WebTestResponse.ContentLength 屬性

取得由要求所傳回之內容的長度。

命名空間:  Microsoft.VisualStudio.TestTools.WebTesting
組件:  Microsoft.VisualStudio.QualityTools.WebTestFramework (在 Microsoft.VisualStudio.QualityTools.WebTestFramework.dll 中)

語法

'宣告
Public Property ContentLength As Long
public long ContentLength { get; internal set; }
public:
property long long ContentLength {
    long long get ();
    internal: void set (long long value);
}
member ContentLength : int64 with get, internal set
function get ContentLength () : long
internal function set ContentLength (value : long)

屬性值

型別:System.Int64
由要求傳回的位元組數目。內容長度不包含標頭資訊。

例外狀況

例外狀況 條件
ObjectDisposedException

已經處置目前的執行個體。

備註

ContentLength 屬性包含由回應所傳回的內容長度標頭中的值。 如果在回應中沒有設定內容長度標頭,ContentLength 的值將設為 -1。

.NET Framework 安全性

請參閱

參考

WebTestResponse 類別

Microsoft.VisualStudio.TestTools.WebTesting 命名空間

其他資源

HTTP