WebTestResponse.ContentLength プロパティ

更新 : 2007 年 11 月

要求によって返されるコンテンツの長さを取得します。

名前空間 :  Microsoft.VisualStudio.TestTools.WebTesting
アセンブリ :  Microsoft.VisualStudio.QualityTools.WebTestFramework (Microsoft.VisualStudio.QualityTools.WebTestFramework.dll 内)

構文

'宣言
Public ReadOnly Property ContentLength As Long
'使用
Dim instance As WebTestResponse
Dim value As Long

value = instance.ContentLength
public long ContentLength { get; }
public:
property long long ContentLength {
    long long get ();
}
public function get ContentLength () : long

プロパティ値

型 : System.Int64

要求によって返されるバイト数。ヘッダー情報はコンテンツの長さには含まれません。

例外

例外 条件
ObjectDisposedException

現在のインスタンスは破棄されています。

解説

ContentLength プロパティには、応答と共に返される Content-Length ヘッダーの値が格納されます。応答で Content-Length ヘッダーが設定されていない場合、ContentLength の値は -1 に設定されます。

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

WebTestResponse クラス

WebTestResponse メンバ

Microsoft.VisualStudio.TestTools.WebTesting 名前空間

その他の技術情報

HTTP