HttpRequest.ContentEncoding 屬性

定義

取得實體 (Entity) 主體的字元集 (Character Set)。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

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.

適用於