HttpRequest.ContentEncoding HttpRequest.ContentEncoding HttpRequest.ContentEncoding HttpRequest.ContentEncoding Property

定义

获取或设置实体主体的字符集。Gets or sets the character set of the entity-body.

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 对象。An Encoding object representing the client's character set.

示例

下面的代码示例将一个表示当前 HTTP 编码说明的值分配给一个字符串变量。The following code example assigns a value representing the description of the current HTTP encoding to a string variable.

String EncodingType;
 EncodingType = Request.ContentEncoding.EncodingName;
   
Dim EncodingType As String
 EncodingType = Request.ContentEncoding.EncodingName
   

注解

可以在配置文件的全球化元素(ASP.NET 设置架构)中指定默认内容编码。Default content encoding can be specified in the globalization Element (ASP.NET Settings Schema) of a configuration file. 如果客户端也指定了内容编码,则会重写默认配置设置。If content encoding is also specified by the client, the default configuration settings are overridden.

适用于