HtmlTextWriter.Encoding 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取 HtmlTextWriter 对象用于将内容写入页面的编码。
public:
virtual property System::Text::Encoding ^ Encoding { System::Text::Encoding ^ get(); };
public override System.Text.Encoding Encoding { get; }
member this.Encoding : System.Text.Encoding
Public Overrides ReadOnly Property Encoding As Encoding
属性值
将标记写入页中时所采用的 Encoding。
示例
下面的代码示例演示如何使用 Encoding 属性编写自定义控件用来将文本呈现给包含它的页面的编码类型。
// Get the value of the current markup writer's
// Encoding property, convert it to a string, and
// write it to the markup stream.
writer->Write( String::Concat( "Encoding : ", writer->Encoding, "<br>" ) );
// Get the value of the current markup writer's
// Encoding property, convert it to a string, and
// write it to the markup stream.
writer.Write("Encoding : " + writer.Encoding.ToString() + "<br>");
' Get the value of the current markup writer's
' Encoding property, convert it to a string, and
' write it to the HtmlTextWriter stream.
writer.Write(("Encoding : " + writer.Encoding.ToString() & "<br>"))
注解
该 Encoding 属性从基 TextWriter 对象获取其值。