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

屬性值

字串,描述傳回至用戶端的 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.

例外狀況

StatusDescription 在 HTTP 標頭送出之後被設定。StatusDescription 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

適用於