WebOperationContext.IncomingResponse 属性

定义

获取正在接收的响应的 Web 响应上下文。

public:
 property System::ServiceModel::Web::IncomingWebResponseContext ^ IncomingResponse { System::ServiceModel::Web::IncomingWebResponseContext ^ get(); };
public System.ServiceModel.Web.IncomingWebResponseContext IncomingResponse { get; }
member this.IncomingResponse : System.ServiceModel.Web.IncomingWebResponseContext
Public ReadOnly Property IncomingResponse As IncomingWebResponseContext

属性值

IncomingWebResponseContext

一个 IncomingWebResponseContext 实例。

示例

下面的代码演示如何从 IncomingResponse 获取内容长度、内容类型和状态代码。

WebOperationContext current = WebOperationContext.Current;
Console.WriteLine("Incoming Response");
Console.WriteLine("ContentLength: " + current.IncomingResponse.ContentLength);
Console.WriteLine("ContentType: " + current.IncomingResponse.ContentType);
Console.WriteLine("StatusCode: " + current.IncomingResponse.StatusCode);
Dim current As WebOperationContext = WebOperationContext.Current
Console.WriteLine("Incoming Response")
Console.WriteLine("ContentLength: " + current.IncomingResponse.ContentLength)
Console.WriteLine("ContentType: " + current.IncomingResponse.ContentType)
Console.WriteLine("StatusCode: " + current.IncomingResponse.StatusCode)

适用于