HttpResponse.StatusDescription 属性

定义

获取或设置返回给客户端的输出的 HTTP 状态字符串。Gets or sets the HTTP status string of the output returned to the client.

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 输出的状态。A string that describes the status of the HTTP output returned to the client. 默认值为 "OK"。The default value is "OK". 有关有效状态代码的列表,请参阅 HTTP 状态代码For a listing of valid status codes, see HTTP Status Codes.

例外

发送 HTTP 标头后设置 StatusDescriptionStatusDescription is set after the HTTP headers have been sent.

所选值的长度大于 512。The selected value has a length greater than 512.

示例

下面的示例检查输出流的状态字符串。The following example checks the status string of the output stream. 如果状态不等于 "确定",则执行其他代码。If the status is not equal to "OK", additional code is executed.

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

适用于