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)

属性值

类型:Int64
由请求所返回的字节数。内容长度不包括标头信息。

异常

异常 条件
ObjectDisposedException

已释放当前的实例。

备注

ContentLength 属性包含与响应一起返回的 Content-Length 标头的值。 如果响应中未设置 Content-Length 标头,则将 ContentLength 设置为值 -1。

.NET Framework 安全性

请参阅

参考

WebTestResponse 类

Microsoft.VisualStudio.TestTools.WebTesting 命名空间

其他资源

HTTP