HttpResponse.ContentEncoding HttpResponse.ContentEncoding HttpResponse.ContentEncoding HttpResponse.ContentEncoding Property

定义

获取或设置输出流的 HTTP 字符集。Gets or sets the HTTP character set of the output stream.

public:
 property System::Text::Encoding ^ ContentEncoding { System::Text::Encoding ^ get(); void set(System::Text::Encoding ^ value); };
public System.Text.Encoding ContentEncoding { get; set; }
member this.ContentEncoding : System.Text.Encoding with get, set
Public Property ContentEncoding As Encoding

属性值

包含当前响应的字符集相关信息的 Encoding 对象。A Encoding object that contains information about the character set of the current response.

异常

示例

下面的示例将字符集编码的可读说明写入输出流。The following example writes a human-readable description of the character set encoding to the output stream.

Response.Write (Response.ContentEncoding.EncodingName);
    
Response.Write (Response.ContentEncoding.EncodingName)
    

注解

ContentEncoding全球化元素(ASP.NET 设置架构)部分的 ASP.NET 配置文件中指定默认值。Default ContentEncoding can be specified in an ASP.NET configuration file in the globalization Element (ASP.NET Settings Schema) section. 如果ContentEncoding客户端指定了,则将重写默认配置设置。If ContentEncoding is specified by the client, the default configuration settings are overridden.

适用于