HttpResponse.Charset 屬性

定義

取得或設定輸出資料流的 HTTP 字元集。Gets or sets the HTTP character set of the output stream.

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

屬性值

輸出資料流的 HTTP 字元集。The HTTP character set of the output stream.

例外狀況

在標頭送出之後,設定 Charset 屬性。The Charset property was set after headers were sent.

範例

下列範例會檢查輸出資料流程的字元集是否為中央歐洲(ISO)。The following example checks whether the character set of the output stream is Central European (ISO).

if (Response.Charset == "iso-8859-2")
{
    // ...
}
If Response.Charset = "iso-8859-2" Then
    '...
End If

備註

屬性可以設定為null ,以隱藏 HTTP Content-Type標頭。 CharsetThe Charset property can be set to null to suppress the HTTP Content-Type header.

適用於