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 物件取得其值。