HttpResponse.Charset HttpResponse.Charset HttpResponse.Charset HttpResponse.Charset Property

定义

获取或设置输出流的 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.

适用于