WebMessageEncodingElement.WriteEncoding Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the character set encoding to be used for emitting messages on the binding.
public:
property System::Text::Encoding ^ WriteEncoding { System::Text::Encoding ^ get(); void set(System::Text::Encoding ^ value); };
[System.ComponentModel.TypeConverter(typeof(System.ServiceModel.Configuration.EncodingConverter))]
[System.Configuration.ConfigurationProperty("writeEncoding", DefaultValue="utf-8")]
public System.Text.Encoding WriteEncoding { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.ServiceModel.Configuration.EncodingConverter))>]
[<System.Configuration.ConfigurationProperty("writeEncoding", DefaultValue="utf-8")>]
member this.WriteEncoding : System.Text.Encoding with get, set
Public Property WriteEncoding As Encoding
Property Value
A valid Encoding value that specifies the character set encoding to be used for emitting messages on the binding. The default is UTF8Encoding.
- Attributes
Exceptions
The value set is null
.
Examples
using System;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.ServiceModel.Configuration;
static void Main()
{
Encoding webMessageEncoding = webMEE.WriteEncoding;
Console.WriteLine("The write encoding is: {0}", webMessageEncoding);
webMessageEncoding = UnicodeEncoding.Unicode;
Console.WriteLine("The write encoding has been changed to: {0}", webMessageEncoding);
}
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET