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

屬性值

字串,描述傳回至用戶端的 HTTP 輸出的狀態。 預設值為 [確定]。 如需有效狀態代碼的清單,請參閱 HTTP 狀態代碼

例外狀況

StatusDescription 在 HTTP 標頭送出之後被設定。

選取的值長度大於 512。

範例

下列範例會檢查輸出數據流的狀態字串。 如果狀態不等於 「OK」 則會執行其他程式代碼。

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

適用於