HttpResponse.StatusDescription 属性

定义

获取或设置返回给客户端的输出的 HTTP 状态字符串。

public:
 property System::String ^ StatusDescription { System::String ^ get(); void set(System::String ^ value); };
public string StatusDescription { get; set; }
member this.StatusDescription : string with get, set
Public Property StatusDescription As String

属性值

String

一个字符串,描述返回给客户端的 HTTP 输出的状态。 默认值为 "OK"。 有关有效状态代码的列表,请参阅 HTTP 状态代码

例外

发送 HTTP 标头后设置 StatusDescription

所选值的长度大于 512。

示例

以下示例检查输出流的状态字符串。 如果状态不等于“确定”,则执行其他代码。

if (Response.StatusDescription != "OK")
{
    // ...
}
If Response.StatusDescription <> "OK" Then
    '...
End If

适用于