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 物件,代表用戶端的字元集。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.