HttpResponse.ContentEncoding 属性
定义
获取或设置输出流的 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.
例外
尝试将 ContentEncoding 设置为 null。Attempted to set ContentEncoding to null.
示例
下面的示例将字符集编码的可读说明写入输出流。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 配置文件中的配置文件中指定 Default, (ASP.NET Settings Schema) 部分。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.