次の方法で共有


HtmlTextWriter.Encoding プロパティ

HtmlTextWriter オブジェクトがページに内容を書き込むために使用するエンコーディングを取得します。

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)

構文

'宣言
Public Overrides ReadOnly Property Encoding As Encoding
'使用
Dim instance As HtmlTextWriter
Dim value As Encoding

value = instance.Encoding
public override Encoding Encoding { get; }
public:
virtual property Encoding^ Encoding {
    Encoding^ get () override;
}
/** @property */
public Encoding get_Encoding ()
public override function get Encoding () : Encoding
適用できません。

プロパティ値

マークアップをページに書き込むときに使用される Encoding

解説

Encoding プロパティは、TextWriter 基本オブジェクトから値を取得します。

使用例

Encoding プロパティを使用して、カスタム コントロールがページにテキストを出力するときに使用するエンコードの種類を、このコントロールを含むページに出力する方法を次のコード例に示します。

' 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>"))
// 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 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.get_Encoding().ToString() 
    + "<br>");

プラットフォーム

Windows 98,Windows Server 2000 SP4,Windows CE,Windows Millennium Edition,Windows Mobile for Pocket PC,Windows Mobile for Smartphone,Windows Server 2003,Windows XP Media Center Edition,Windows XP Professional x64 Edition,Windows XP SP2,Windows XP Starter Edition

Microsoft .NET Framework 3.0 は Windows Vista,Microsoft Windows XP SP2,および Windows Server 2003 SP1 でサポートされています。

バージョン情報

.NET Framework

サポート対象 : 3.0,2.0,1.1,1.0

参照

関連項目

HtmlTextWriter クラス
HtmlTextWriter メンバ
System.Web.UI 名前空間
TextWriter
Encoding