XhtmlTextWriter XhtmlTextWriter XhtmlTextWriter XhtmlTextWriter Class

定義

將可延伸超文字標記語言 (XHTML) 特定字元 (包括衍生自 XTHML 的 XHTML 模組所有變異) 寫入 ASP.NET 伺服器控制項的輸出資料流,供行動裝置使用。Writes Extensible Hypertext Markup Language (XHTML)-specific characters, including all variations of XHTML modules that derive from XHTML, to the output stream for an ASP.NET server control for mobile devices. 請覆寫 XhtmlTextWriter 類別,為 ASP.NET 網頁和伺服器控制項提供自訂 XHTML 呈現。Override the XhtmlTextWriter class to provide custom XHTML rendering for ASP.NET pages and server controls.

public ref class XhtmlTextWriter : System::Web::UI::HtmlTextWriter
public class XhtmlTextWriter : System.Web.UI.HtmlTextWriter
type XhtmlTextWriter = class
    inherit HtmlTextWriter
Public Class XhtmlTextWriter
Inherits HtmlTextWriter
繼承

範例

本節中的程式碼範例包含四個部分。The code example in this section contains four parts. 第一個範例示範如何建立衍生類別。The first example demonstrates how to create a derived class. 第二個程式碼範例示範如何建立自訂控制項。The second code example demonstrates how to create a custom control. 第三個程式碼範例示範如何使用自訂控制項。The third code example demonstrates how to use the custom control. 第四個程式碼範例提供執行自訂控制項所需的程式碼。The fourth code example provides the code that is required to run the custom control.

下列程式碼範例示範如何建立衍生XhtmlTextWriter自類別的自訂類別。The following code example demonstrates how to create a custom class that is derived from the XhtmlTextWriter class. 它有兩個函式, 對於直接或間接繼承自HtmlTextWriter類別的所有類別而言, 這是標準的。It has two constructors, which is standard for all classes that inherit directly or indirectly from the HtmlTextWriter class. 第一個函式會TextWriter採用物件做為參數, 並呼叫第二個函式, 並傳遞下列兩個參數值:The first constructor takes a TextWriter object as a parameter and calls the second constructor, passing the following two parameter values:

這個程式碼範例也會示範如何覆OnAttributeRenderOnStyleAttributeRender和方法, 分別篩選文字大小和色彩樣式。This code example also shows how to override the OnAttributeRender and OnStyleAttributeRender methods to filter for text size and color style, respectively. 此外, 它會覆BeginRenderEndRender和方法, 以在呈現控制項之前和之後寫入文字字串。Additionally, it overrides the BeginRender and EndRender methods to write a text string before and after a control has rendered.

using System;
using System.IO;
using System.Web;
using System.Security.Permissions;
using System.Web.UI;
using System.Web.UI.Adapters;
using System.Web.UI.WebControls.Adapters;

namespace Samples.AspNet.CS
{
    // Create a class that inherits from XhtmlTextWriter.
    [AspNetHostingPermission(SecurityAction.Demand, 
        Level=AspNetHostingPermissionLevel.Minimal)]
    [AspNetHostingPermission(SecurityAction.InheritanceDemand, 
        Level=AspNetHostingPermissionLevel.Minimal)] 
    public class CustomXhtmlTextWriter : XhtmlTextWriter
    {
        // Create two constructors, following 
        // the pattern for implementing a
        // TextWriter constructor.
        public CustomXhtmlTextWriter(TextWriter writer) : 
            this(writer, DefaultTabString)
        {
        }


        public CustomXhtmlTextWriter(TextWriter writer, string tabString) : 
            base(writer, tabString)
        {
        }


        // Override the OnAttributeRender method to 
        // allow this text writer to render only eight-point 
        // text size.
        protected override bool OnAttributeRender(string name, 
          string value, 
          HtmlTextWriterAttribute key) 
        {
            if (key == HtmlTextWriterAttribute.Size)
            {
                if (String.Compare(value, "8pt") == 0)
                {
                    return true;
                }
                else
                {
                   return false;
                } 
             }
             else
             {
                 return base.OnAttributeRender(name, value, key);
             }

         }
        
        // Override the OnStyleAttributeRender
        // method to prevent this text writer 
        // from rendering purple text.
        protected override bool OnStyleAttributeRender(string name, 
            string value, 
            HtmlTextWriterStyle key)
        {
            if (key == HtmlTextWriterStyle.Color)
            {
                if (String.Compare(value, "purple") == 0)
                {
                    return false;
                }
                else
                {
                    return true;
                }
            }
            else
            {
                return base.OnStyleAttributeRender(name, value, key);
            }        
        }  

        // Override the BeginRender method to write a
        // message and call the WriteBreak method
        // before a control is rendered.
        override public void BeginRender()
        {
           this.Write("A control is about to render.");
           this.WriteBreak();
        }
        
        // Override the EndRender method to
        // write a string immediately after 
        // a control has rendered. 
        override public void EndRender()
        {
           this.Write("A control just rendered.");
        }  
         
    }
}
Imports System.IO
Imports System.Web
Imports System.Security.Permissions
Imports System.Web.UI
Imports System.Web.UI.Adapters
Imports System.Web.UI.WebControls.Adapters

Namespace Samples.AspNet.VB

    ' Create a class that inherits from XhtmlTextWriter.
    <AspNetHostingPermission(SecurityAction.Demand, _
        Level:=AspNetHostingPermissionLevel.Minimal)> _
    <AspNetHostingPermission(SecurityAction.InheritanceDemand, _
        Level:=AspNetHostingPermissionLevel.Minimal)> _
    Public Class CustomXhtmlTextWriter
        Inherits XhtmlTextWriter

        ' Create two constructors, following 
        ' the pattern for implementing a
        ' TextWriter constructor.
        Public Sub New(writer As TextWriter)
          MyClass.New(writer, DefaultTabString)
        End Sub


        Public Sub New(writer As TextWriter, tabString As String)
          MyBase.New(writer, tabString)
        End Sub


        ' Override the OnAttributeRender method to 
        ' allow this text writer to render only eight-point 
        ' text size.
        Overrides Protected Function OnAttributeRender(ByVal name As String, _
          ByVal value As String, _
          ByVal key As HtmlTextWriterAttribute _
        ) As Boolean
           If key = HtmlTextWriterAttribute.Size Then
              If String.Compare(value, "8pt") = 0 Then
                 Return True
              Else
                 Return False
              End If 
           Else
              Return MyBase.OnAttributeRender(name, value, key)
           End If
        End Function
        
        ' Override the OnStyleAttributeRender
        ' method to prevent this text writer 
        ' from rendering purple text.
        Overrides Protected Function OnStyleAttributeRender(ByVal name As String, _
          ByVal value As String, _
          ByVal key As HtmlTextWriterStyle _
        ) As Boolean
           If key = HtmlTextWriterStyle.Color Then
              If String.Compare(value, "purple") = 0 Then
                 Return False
              Else
                 Return True
              End If
           Else
              Return MyBase.OnStyleAttributeRender(name, value, key)        
           End If
        End Function  

        ' Override the BeginRender method to write a
        ' message and call the WriteBreak method
        ' before a control is rendered.
        Overrides Public Sub BeginRender()
           Me.Write("A control is about to render.")
           Me.WriteBreak()
        End Sub
        
        ' Override the EndRender method to
        ' write a string immediately after 
        ' a control has rendered. 
        Overrides Public Sub EndRender()
           Me.Write("A control just rendered.")
        End Sub  
         
    End Class
End Namespace

下列程式碼範例示範如何建立名為Label TestLabel的自訂控制項, 以及名為XhtmlTestLabelAdapter的自訂介面卡, 它會將控制項的內容呈現為 XHTML。The following code example demonstrates how to create a custom Label control named TestLabel and a custom adapter named XhtmlTestLabelAdapter that renders the content of the control as XHTML.

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.Adapters;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.Adapters;

namespace AspNet.Samples
{
	// Create a simple class that inherits
    // from the Label class.
	public class TestLabel : Label
	{
		private String _textValue;

		// Override the Text property.
		public override string Text
		{
			get
			{
				return (string)ViewState["Text"];
			}
			set
			{
				ViewState["Text"] = value;
			}
		}
	}
	public class XhtmlTestLabelAdapter : WebControlAdapter
	{
		// Create a control property that accesses the
		// methods and properties of the control.
		protected TestLabel Control
		{
			get
			{
				return (TestLabel)base.Control;
			}
		}

		protected override void Render(HtmlTextWriter writer)
		{
			// Create an instance of the XhtmlTextWriter class,
			// named w, and cast the HtmlTextWriter passed 
			// in the writer parameter to w.
			XhtmlTextWriter w = new XhtmlTextWriter(writer);

			// Create a string variable, named value, to hold
			// the control's Text property value.
			String value = Control.Text;

			
            // Create a Boolean variable, named attTest,
            // to test whether the Style attribute is 
            // valid in the page that the control is
            // rendered to.
            Boolean attTest = w.IsValidFormAttribute("style");

            // Check whether attTest is true or false.
            // If true, a style is applied to the XHTML
            // content. If false, no style is applied.
			if (attTest)
				w.EnterStyle(Control.ControlStyle);

			// Write the Text property value of the control,
            // a <br> element, and a string. Consider encoding the value using WriteEncodedText.
            w.Write(value);
            w.WriteBreak();
            w.Write("This control conditionally rendered its styles for XHTML.");

            // Check whether attTest is true or false.
            // If true, the XHTML style is closed.
            // If false, nothing is rendered.
            if (attTest)
                w.ExitStyle(Control.ControlStyle);
		}

	}

}
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.Adapters
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.Adapters

Namespace AspNet.Samples
    ' Create a simple class that inherits
    ' from the Label class.
    Public Class TestLabel
      Inherits Label

      Private textValue As String
      
      ' Override the Text property.
      Overrides Public Property Text As String
         Get
                Return CStr(ViewState("Text"))
         End Get
         
         Set
                ViewState("Text") = Value
         End Set
        End Property

    End Class
    ' Create a class to render the custom Label's
    ' content to XHTML devices.
    Public Class XhtmlTestLabelAdapter
         Inherits WebControlAdapter

   
      ' Create a Control property that accesses the 
      ' methods and properties of the control.
      Protected Shadows ReadOnly Property Control() As TestLabel
         Get
            Return CType(MyBase.Control, TestLabel)
         End Get
      End Property
   
        ' Override the Render method.
        Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)

            ' Create an instance of the XhtmlTextWriter class, 
            ' named w, and cast the HtmlTextWriter passed 
            ' in the writer parameter to w.
            Dim w As XhtmlTextWriter = New XhtmlTextWriter(writer)

            ' Create a string variable, named value, to hold
            ' the control's Text property value.
            Dim value As String = Control.Text

            ' Create a Boolean variable, named attTest,
            ' to test whether the Style attribute is 
            ' valid in the page that the control is
            ' rendered to.
            Dim attTest As Boolean = w.IsValidFormAttribute("style")

            ' Check whether attTest is true or false.
            ' If true, a style is applied to the XHTML
            ' content. If false, no style is applied.
            If (attTest = True) Then
                w.EnterStyle(Control.ControlStyle)
            End If

            ' Write the Text property value of the control,
            ' a <br> element, and a string. Consider encoding the value using WriteEncodedText.
            w.Write(value)
            w.WriteBreak()
            w.Write("This control conditionally rendered its styles for XHTML.")

            ' Check whether attTest is true or false.
            ' If true, the XHTML style is closed.
            ' If false, nothing is rendered.
            If (attTest = True) Then
                w.ExitStyle(Control.ControlStyle)
            End If

        End Sub

    End Class
End Namespace

下列程式碼範例示範如何在 ASP.NET 的網頁上TestLabel使用自訂控制項。The following code example demonstrates how to use the custom control TestLabel on an ASP.NET Web page.

<%@ Page Language="C#" %>
<%@ Import Namespace="AspNet.Samples" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  protected void Page_Load(object sender, EventArgs e)
  {
    TestLabel tl = new TestLabel();
    tl.ID = "TestLabel1";
    PlaceHolder1.Controls.Add(tl);

  }
</script>


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>XHtmlTextWriter Example</title>
</head>
<body>
    <form id="form1" runat="server" >
    <div>
      <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>    
    </div>
    </form>
</body>
</html>
<%@ Page Language="VB"   %>
<%@ Import Namespace="AspNet.Samples" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

    Dim tl As TestLabel = New TestLabel()
    tl.ID = "TestLabel1"
    PlaceHolder1.Controls.Add(tl)
    
  End Sub
  
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>XHtmlTextWriter Example</title>
</head>
<body>
    <form id="form1" runat="server" >
    <div>
      <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>    
    </div>
    </form>
</body>
</html>

若要使用上述程式碼範例中的自訂控制項, 請<controlAdapters>將下列專案新增至兩個檔案中的其中一個。To use the custom control in the preceding code example, add the following <controlAdapters> element to one of two files. 您可以在特定瀏覽器的子目錄中, 將它新增至適當的整部電腦檔案, 做為 .NET Framework 設定目錄的子資料夾。You can add it to the appropriate machine-wide file in the subdirectory for a specific browser, as a subfolder of the .NET Framework configuration directory. 或者, 您也可以將它新增至 Web 應用程式根目錄底下的 App_Browsers 目錄中的自訂瀏覽器檔案。Alternatively, you can add it to a custom browser file in the App_Browsers directory under the Web application root.

<controlAdapters>  
   <adapter controlType="AspNet.Samples.TestLabel"  
   adapterType="AspNet.Samples.XhtmlTestLabelAdapter" />  
</controlAdapters>  

備註

XHTML 是以 HTML 4.1 為基礎的 XML 相容標記語言, 可讓您建立適用于多種裝置類型的網站。XHTML is an XML-compliant markup language, based on HTML 4.1, which allows you to create Web sites that are suitable for multiple device types. 它會合並 HTML 所提供的輕鬆使用, 以及 XML 所提供的嚴格元素指導方針, 以產生具有各種格式和樣式選項的標記語言, 並減少標記標記的混淆。It merges the ease of use provided by HTML with the strict element guidelines provided by XML to produce a markup language with a wide range of format and style options, and with reduced markup tag ambiguity. XhtmlTextWriter類別提供將 XHTML 內容轉譯至用戶端時, ASP.NET 伺服器控制項所使用的格式化功能。The XhtmlTextWriter class provides formatting capabilities that ASP.NET server controls use when rendering XHTML content to clients. 您可以使用SetDocType方法來指定文字寫入器所呈現的 XHTML 類型。You can use the SetDocType method to specify which type of XHTML the text writer renders. 支援的XhtmlMobileDocType檔案類型定義于列舉型別中。Supported document types are defined in the XhtmlMobileDocType enumeration.

XhtmlTextWriter類別會呈現專案的兩組屬性。The XhtmlTextWriter class renders two sets of attributes for elements. 一組是一般屬性的集合, 如CommonAttributes屬性中所參考。One set is a collection of common attributes, as referenced in the CommonAttributes property. 第二個集合是元素特有屬性的集合, 如ElementSpecificAttributes屬性中所參考。The second set is a collection of element-specific attributes, as referenced in the ElementSpecificAttributes property. 如需所呈現之元素和樣式的詳細資訊, 請參閱全球資訊網協會 (W3C) 網站上的 XHTML 模組化規格。For more information on the elements and styles that are rendered, see the XHTML modularization specification at the World Wide Web Consortium (W3C) Web site.

您可以使用XhtmlTextWriter類別的成員和任何衍生的類別, 來建立自訂的文字寫入器, 以便在自訂的 XHTML 頁面介面卡或類別介面卡中使用。You can use the members of the XhtmlTextWriter class and any derived classes to create custom text writers to use in custom XHTML page adapters or class adapters. 您也可以建立衍生類別, 以覆寫XhtmlTextWriter類別的標準行為。You can also create derived classes that override the standard behavior of the XhtmlTextWriter class.

根據預設, 當您使用的瀏覽器支援 HTML 4.0 時, ASP.NET 網頁和控制項會呈現與 XHTML 1.1 標準相容的標記。By default, when you are working with browsers that support HTML 4.0, ASP.NET pages and controls render markup that is compatible with the XHTML 1.1 standard. 如需詳細資訊, 請參閱Visual Studio 和 ASP.NET 中的 XHTML 標準For more information, see XHTML Standards in Visual Studio and ASP.NET.

HtmlTextWriter輸出 xhtml, 除非您特別設定 ASP.NET 不要呈現 XHTML 標籤。The HtmlTextWriter outputs XHTML unless you configure ASP.NET specifically to not render XHTML markup. 如需詳細資訊, 請參閱筆尖:HOW TO:在 ASP.NET 的網站中設定 XHTML 轉譯。For more information, see NIB: How to: Configure XHTML Rendering in ASP.NET Web Sites.

建構函式

XhtmlTextWriter(TextWriter) XhtmlTextWriter(TextWriter) XhtmlTextWriter(TextWriter) XhtmlTextWriter(TextWriter)

使用在 XhtmlTextWriter 欄位內指定的行縮排,初始化 DefaultTabString 類別的新執行個體。Initializes a new instance of the XhtmlTextWriter class that uses the line indentation that is specified in the DefaultTabString field. 如果您不要變更預設的行縮排,請使用 XhtmlTextWriter(TextWriter) 建構函式。Use the XhtmlTextWriter(TextWriter) constructor if you do not want to change the default line indentation.

XhtmlTextWriter(TextWriter, String) XhtmlTextWriter(TextWriter, String) XhtmlTextWriter(TextWriter, String) XhtmlTextWriter(TextWriter, String)

使用指定的行縮排,初始化 XhtmlTextWriter 類別的新執行個體。Initializes a new instance of the XhtmlTextWriter class with the specified line indentation.

屬性

CommonAttributes CommonAttributes CommonAttributes CommonAttributes

取得 Hashtable 物件,其中包含 XhtmlTextWriter 物件之標記 (Markup) 型態之標記 (Tag) 的通用屬性。Gets a Hashtable object containing common attributes of the markup tags for the XhtmlTextWriter object.

ElementSpecificAttributes ElementSpecificAttributes ElementSpecificAttributes ElementSpecificAttributes

取得包含項目專用屬性的 Hashtable 物件。Gets a Hashtable object containing element-specific attributes.

Encoding Encoding Encoding Encoding

取得 HtmlTextWriter 物件用來將內容寫入網頁的編碼。Gets the encoding that the HtmlTextWriter object uses to write content to the page.

(Inherited from HtmlTextWriter)
FormatProvider FormatProvider FormatProvider FormatProvider

取得控制格式設定的物件。Gets an object that controls formatting.

(Inherited from TextWriter)
Indent Indent Indent Indent

取得或設定定位點位置的數目,此為標記的每一行開頭要縮排的數目。Gets or sets the number of tab positions to indent the beginning of each line of markup.

(Inherited from HtmlTextWriter)
InnerWriter InnerWriter InnerWriter InnerWriter

取得或設定寫入標記項目內部內容的文字寫入器。Gets or sets the text writer that writes the inner content of the markup element.

(Inherited from HtmlTextWriter)
NewLine NewLine NewLine NewLine

取得或設定 HtmlTextWriter 物件所用的行結束字元字串。Gets or sets the line terminator string used by the HtmlTextWriter object.

(Inherited from HtmlTextWriter)
SuppressCommonAttributes SuppressCommonAttributes SuppressCommonAttributes SuppressCommonAttributes

取得為其隱藏 Hashtable 屬性之項目的 CommonAttributes 物件。Gets a Hashtable object of elements for which CommonAttributes attributes are suppressed.

TagKey TagKey TagKey TagKey

取得或設定指定標記項目的 HtmlTextWriterTag 值。Gets or sets the HtmlTextWriterTag value for the specified markup element.

(Inherited from HtmlTextWriter)
TagName TagName TagName TagName

取得或設定所呈現的標記項目的標記名稱。Gets or sets the tag name of the markup element being rendered.

(Inherited from HtmlTextWriter)

方法

AddAttribute(HtmlTextWriterAttribute, String) AddAttribute(HtmlTextWriterAttribute, String) AddAttribute(HtmlTextWriterAttribute, String) AddAttribute(HtmlTextWriterAttribute, String)

將標記屬性和屬性值加入項目的開頭標記中,此項目是 HtmlTextWriter 物件經過後續呼叫 RenderBeginTag 方法而建立的。Adds the markup attribute and the attribute value to the opening tag of the element that the HtmlTextWriter object creates with a subsequent call to the RenderBeginTag method.

(Inherited from HtmlTextWriter)
AddAttribute(HtmlTextWriterAttribute, String, Boolean) AddAttribute(HtmlTextWriterAttribute, String, Boolean) AddAttribute(HtmlTextWriterAttribute, String, Boolean) AddAttribute(HtmlTextWriterAttribute, String, Boolean)

將標記屬性和屬性值加入項目的開頭標記中,此項目是 HtmlTextWriter 物件經過後續呼叫 RenderBeginTag 方法而建立的 (使用選擇性編碼)。Adds the markup attribute and the attribute value to the opening tag of the element that the HtmlTextWriter object creates with a subsequent call to the RenderBeginTag method, with optional encoding.

(Inherited from HtmlTextWriter)
AddAttribute(String, String) AddAttribute(String, String) AddAttribute(String, String) AddAttribute(String, String)

將指定的標記屬性和值加入項目的開頭標記中,這些項目是 HtmlTextWriter 物件經過後續呼叫 RenderBeginTag 方法而建立的。Adds the specified markup attribute and value to the opening tag of the element that the HtmlTextWriter object creates with a subsequent call to the RenderBeginTag method.

(Inherited from HtmlTextWriter)
AddAttribute(String, String, Boolean) AddAttribute(String, String, Boolean) AddAttribute(String, String, Boolean) AddAttribute(String, String, Boolean)

將指定的標記屬性和值加入項目的開頭標記中,這些項目是 HtmlTextWriter 物件經過後續呼叫 RenderBeginTag 方法而建立的 (使用選擇性編碼)。Adds the specified markup attribute and value to the opening tag of the element that the HtmlTextWriter object creates with a subsequent call to the RenderBeginTag method, with optional encoding.

(Inherited from HtmlTextWriter)
AddAttribute(String, String, HtmlTextWriterAttribute) AddAttribute(String, String, HtmlTextWriterAttribute) AddAttribute(String, String, HtmlTextWriterAttribute) AddAttribute(String, String, HtmlTextWriterAttribute)

將指定的標記屬性和值,連同 HtmlTextWriterAttribute 列舉值,一起加入此項目的開頭標記中,此項目是 HtmlTextWriter 物件經過後續呼叫 RenderBeginTag 方法而建立的。Adds the specified markup attribute and value, along with an HtmlTextWriterAttribute enumeration value, to the opening tag of the element that the HtmlTextWriter object creates with a subsequent call to the RenderBeginTag method.

(Inherited from HtmlTextWriter)
AddRecognizedAttribute(String, String) AddRecognizedAttribute(String, String) AddRecognizedAttribute(String, String) AddRecognizedAttribute(String, String)

將屬性加入至 XHTML 項目。Adds an attribute to an XHTML element. XhtmlTextWriter 物件的項目特定屬性集合是由 ElementSpecificAttributes 屬性所參考。The collection of element-specific attributes for the XhtmlTextWriter object is referenced by the ElementSpecificAttributes property.

AddStyleAttribute(HtmlTextWriterStyle, String) AddStyleAttribute(HtmlTextWriterStyle, String) AddStyleAttribute(HtmlTextWriterStyle, String) AddStyleAttribute(HtmlTextWriterStyle, String)

將與指定的 HtmlTextWriterStyle 值相關聯的標記樣式屬性以及屬性值,加入由對 RenderBeginTag 方法的後續呼叫所建立的開頭標記中。Adds the markup style attribute associated with the specified HtmlTextWriterStyle value and the attribute value to the opening markup tag created by a subsequent call to the RenderBeginTag method.

(Inherited from HtmlTextWriter)
AddStyleAttribute(String, String) AddStyleAttribute(String, String) AddStyleAttribute(String, String) AddStyleAttribute(String, String)

將指定的標記樣式屬性和屬性值加入由對 RenderBeginTag 方法的後續呼叫所建立的開頭標記中。Adds the specified markup style attribute and the attribute value to the opening markup tag created by a subsequent call to the RenderBeginTag method.

(Inherited from HtmlTextWriter)
AddStyleAttribute(String, String, HtmlTextWriterStyle) AddStyleAttribute(String, String, HtmlTextWriterStyle) AddStyleAttribute(String, String, HtmlTextWriterStyle) AddStyleAttribute(String, String, HtmlTextWriterStyle)

將指定的標記樣式屬性和屬性值,連同 HtmlTextWriterStyle 列舉值,一起加入由對 RenderBeginTag 方法的後續呼叫所建立的開頭標記中。Adds the specified markup style attribute and the attribute value, along with an HtmlTextWriterStyle enumeration value, to the opening markup tag created by a subsequent call to the RenderBeginTag method.

(Inherited from HtmlTextWriter)
BeginRender() BeginRender() BeginRender() BeginRender()

將即將要呈現控制項的訊息告知 HtmlTextWriter 物件或衍生類別的物件。Notifies an HtmlTextWriter object, or an object of a derived class, that a control is about to be rendered.

(Inherited from HtmlTextWriter)
Close() Close() Close() Close()

關閉 HtmlTextWriter 物件,並釋放與它相關的任何系統資源。Closes the HtmlTextWriter object and releases any system resources associated with it.

(Inherited from HtmlTextWriter)
CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
Dispose() Dispose() Dispose() Dispose()

釋放由 TextWriter 物件使用的所有資源。Releases all resources used by the TextWriter object.

(Inherited from TextWriter)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

釋放 TextWriter 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by the TextWriter and optionally releases the managed resources.

(Inherited from TextWriter)
DisposeAsync() DisposeAsync() DisposeAsync() DisposeAsync()

以非同步方式釋放由 TextWriter 物件使用的所有資源。Asynchronously releases all resources used by the TextWriter object.

(Inherited from TextWriter)
EncodeAttributeValue(HtmlTextWriterAttribute, String) EncodeAttributeValue(HtmlTextWriterAttribute, String) EncodeAttributeValue(HtmlTextWriterAttribute, String) EncodeAttributeValue(HtmlTextWriterAttribute, String)

根據目前內容中 HttpRequest 物件的需求來編碼指定標記屬性的值。Encodes the value of the specified markup attribute based on the requirements of the HttpRequest object of the current context.

(Inherited from HtmlTextWriter)
EncodeAttributeValue(String, Boolean) EncodeAttributeValue(String, Boolean) EncodeAttributeValue(String, Boolean) EncodeAttributeValue(String, Boolean)

根據目前內容中 HttpRequest 物件的需求來編碼指定標記屬性的值。Encodes the value of the specified markup attribute based on the requirements of the HttpRequest object of the current context.

(Inherited from HtmlTextWriter)
EncodeUrl(String) EncodeUrl(String) EncodeUrl(String) EncodeUrl(String)

執行最少的 URL 編碼,透過的方式是將指定 URL 中的空格轉換為字串 "%20"。Performs minimal URL encoding by converting spaces in the specified URL to the string "%20".

(Inherited from HtmlTextWriter)
EndRender() EndRender() EndRender() EndRender()

將控制項已完成呈現的訊息告知 HtmlTextWriter 物件或衍生類別的物件。Notifies an HtmlTextWriter object, or an object of a derived class, that a control has finished rendering. 您可以使用此方法來關閉在 BeginRender() 方法中所開啟的任何標記項目。You can use this method to close any markup elements opened in the BeginRender() method.

(Inherited from HtmlTextWriter)
EnterStyle(Style) EnterStyle(Style) EnterStyle(Style) EnterStyle(Style)

寫入 <span> 項目的開頭標記,該項目包含實作指定樣式之配置和字元格式的屬性。Writes the opening tag of a <span> element that contains attributes that implement the layout and character formatting of the specified style.

(Inherited from HtmlTextWriter)
EnterStyle(Style, HtmlTextWriterTag) EnterStyle(Style, HtmlTextWriterTag) EnterStyle(Style, HtmlTextWriterTag) EnterStyle(Style, HtmlTextWriterTag)

寫入標記項目的開頭標記,該標記項目包含實作指定樣式之配置和字元格式的屬性。Writes the opening tag of a markup element that contains attributes that implement the layout and character formatting of the specified style.

(Inherited from HtmlTextWriter)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
ExitStyle(Style) ExitStyle(Style) ExitStyle(Style) ExitStyle(Style)

寫入 <span> 項目的結尾標記,以結束指定的配置與字元格式。Writes the closing tag of a <span> element to end the specified layout and character formatting.

(Inherited from HtmlTextWriter)
ExitStyle(Style, HtmlTextWriterTag) ExitStyle(Style, HtmlTextWriterTag) ExitStyle(Style, HtmlTextWriterTag) ExitStyle(Style, HtmlTextWriterTag)

寫入指定標記項目的結尾標記,以結束指定的版面配置與字元格式設定。Writes the closing tag of the specified markup element to end the specified layout and character formatting.

(Inherited from HtmlTextWriter)
FilterAttributes() FilterAttributes() FilterAttributes() FilterAttributes()

移除網頁或 Web 伺服器控制項的所有屬性上的所有標記和樣式屬性。Removes all the markup and style attributes on all properties of the page or Web server control.

(Inherited from HtmlTextWriter)
Flush() Flush() Flush() Flush()

清除目前 HtmlTextWriter 物件的所有緩衝區,並使任何緩衝的資料寫入輸出資料流。Clears all buffers for the current HtmlTextWriter object and causes any buffered data to be written to the output stream.

(Inherited from HtmlTextWriter)
FlushAsync() FlushAsync() FlushAsync() FlushAsync()

以非同步的方式清除目前寫入器的所有緩衝區,並造成任何緩衝資料都寫入基礎裝置。Asynchronously clears all buffers for the current writer and causes any buffered data to be written to the underlying device.

(Inherited from TextWriter)
GetAttributeKey(String) GetAttributeKey(String) GetAttributeKey(String) GetAttributeKey(String)

取得指定屬性的對應 HtmlTextWriterAttribute 列舉值。Obtains the corresponding HtmlTextWriterAttribute enumeration value for the specified attribute.

(Inherited from HtmlTextWriter)
GetAttributeName(HtmlTextWriterAttribute) GetAttributeName(HtmlTextWriterAttribute) GetAttributeName(HtmlTextWriterAttribute) GetAttributeName(HtmlTextWriterAttribute)

取得與指定的 HtmlTextWriterAttribute 值相關聯的標記屬性名稱。Obtains the name of the markup attribute associated with the specified HtmlTextWriterAttribute value.

(Inherited from HtmlTextWriter)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetStyleKey(String) GetStyleKey(String) GetStyleKey(String) GetStyleKey(String)

取得指定樣式的 HtmlTextWriterStyle 列舉值。Obtains the HtmlTextWriterStyle enumeration value for the specified style.

(Inherited from HtmlTextWriter)
GetStyleName(HtmlTextWriterStyle) GetStyleName(HtmlTextWriterStyle) GetStyleName(HtmlTextWriterStyle) GetStyleName(HtmlTextWriterStyle)

取得與指定的 HtmlTextWriterStyle 列舉值相關聯的標記樣式屬性名稱。Obtains the markup style attribute name associated with the specified HtmlTextWriterStyle enumeration value.

(Inherited from HtmlTextWriter)
GetTagKey(String) GetTagKey(String) GetTagKey(String) GetTagKey(String)

取得與指定標記項目相關聯的 HtmlTextWriterTag 列舉值。Obtains the HtmlTextWriterTag enumeration value associated with the specified markup element.

(Inherited from HtmlTextWriter)
GetTagName(HtmlTextWriterTag) GetTagName(HtmlTextWriterTag) GetTagName(HtmlTextWriterTag) GetTagName(HtmlTextWriterTag)

取得與指定 HtmlTextWriterTag 列舉值相關聯的標記項目。Obtains the markup element associated with the specified HtmlTextWriterTag enumeration value.

(Inherited from HtmlTextWriter)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

取得存留期服務物件,以控制這個執行個體的存留期原則。Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
IsAttributeDefined(HtmlTextWriterAttribute) IsAttributeDefined(HtmlTextWriterAttribute) IsAttributeDefined(HtmlTextWriterAttribute) IsAttributeDefined(HtmlTextWriterAttribute)

判斷指定的標記屬性和其值是否在下一次呼叫 RenderBeginTag 方法期間呈現。Determines whether the specified markup attribute and its value are rendered during the next call to the RenderBeginTag method.

(Inherited from HtmlTextWriter)
IsAttributeDefined(HtmlTextWriterAttribute, String) IsAttributeDefined(HtmlTextWriterAttribute, String) IsAttributeDefined(HtmlTextWriterAttribute, String) IsAttributeDefined(HtmlTextWriterAttribute, String)

判斷指定的標記屬性和其值是否在下一次呼叫 RenderBeginTag 方法期間呈現。Determines whether the specified markup attribute and its value are rendered during the next call to the RenderBeginTag method.

(Inherited from HtmlTextWriter)
IsStyleAttributeDefined(HtmlTextWriterStyle) IsStyleAttributeDefined(HtmlTextWriterStyle) IsStyleAttributeDefined(HtmlTextWriterStyle) IsStyleAttributeDefined(HtmlTextWriterStyle)

判斷指定的標記樣式屬性是否會在 RenderBeginTag 方法的下一個呼叫期間呈現。Determines whether the specified markup style attribute is rendered during the next call to the RenderBeginTag method.

(Inherited from HtmlTextWriter)
IsStyleAttributeDefined(HtmlTextWriterStyle, String) IsStyleAttributeDefined(HtmlTextWriterStyle, String) IsStyleAttributeDefined(HtmlTextWriterStyle, String) IsStyleAttributeDefined(HtmlTextWriterStyle, String)

判斷指定的標記樣式屬性以及該屬性的值是否會在 RenderBeginTag 方法的下一個呼叫期間呈現。Determines whether the specified markup style attribute and its value are rendered during the next call to the RenderBeginTag method.

(Inherited from HtmlTextWriter)
IsValidFormAttribute(String) IsValidFormAttribute(String) IsValidFormAttribute(String) IsValidFormAttribute(String)

檢查 XHTML 屬性,確定該屬性可以呈現在 <form> 項目的開頭標記中。Checks an XHTML attribute to ensure that it can be rendered in the opening tag of a <form> element.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
OnAttributeRender(String, String, HtmlTextWriterAttribute) OnAttributeRender(String, String, HtmlTextWriterAttribute) OnAttributeRender(String, String, HtmlTextWriterAttribute) OnAttributeRender(String, String, HtmlTextWriterAttribute)

判斷指定的 XHTML 屬性以及該屬性的值是否可以在目前的標記項目中呈現。Determines whether the specified XHTML attribute and its value can be rendered to the current markup element.

OnStyleAttributeRender(String, String, HtmlTextWriterStyle) OnStyleAttributeRender(String, String, HtmlTextWriterStyle) OnStyleAttributeRender(String, String, HtmlTextWriterStyle) OnStyleAttributeRender(String, String, HtmlTextWriterStyle)

判斷指定的 XHTML 樣式屬性以及該屬性的值是否可以在目前的標記項目中呈現。Determines whether the specified XHTML style attribute and its value can be rendered to the current markup element.

OnTagRender(String, HtmlTextWriterTag) OnTagRender(String, HtmlTextWriterTag) OnTagRender(String, HtmlTextWriterTag) OnTagRender(String, HtmlTextWriterTag)

判斷指定的標記項目是否將在提出要求的網頁上呈現。Determines whether the specified markup element will be rendered to the requesting page.

(Inherited from HtmlTextWriter)
OutputTabs() OutputTabs() OutputTabs() OutputTabs()

寫入一系列的定位字串,表示一行的標記字元的縮排層次。Writes a series of tab strings that represent the indentation level for a line of markup characters.

(Inherited from HtmlTextWriter)
PopEndTag() PopEndTag() PopEndTag() PopEndTag()

從已呈現項目的清單中移除最近儲存的標記項目。Removes the most recently saved markup element from the list of rendered elements.

(Inherited from HtmlTextWriter)
PushEndTag(String) PushEndTag(String) PushEndTag(String) PushEndTag(String)

在產生標記項目的結尾標記時,儲存指定的標記項目,方便以後使用。Saves the specified markup element for later use when generating the end tag for a markup element.

(Inherited from HtmlTextWriter)
RemoveRecognizedAttribute(String, String) RemoveRecognizedAttribute(String, String) RemoveRecognizedAttribute(String, String) RemoveRecognizedAttribute(String, String)

從項目的 ElementSpecificAttributes 集合中移除屬性。Removes an attribute from the ElementSpecificAttributes collection of an element.

RenderAfterContent() RenderAfterContent() RenderAfterContent() RenderAfterContent()

將標記項目的內容之後及結尾標記之前出現的任何文字或間距,寫入標記輸出資料流。Writes any text or spacing that occurs after the content and before the closing tag of the markup element to the markup output stream.

(Inherited from HtmlTextWriter)
RenderAfterTag() RenderAfterTag() RenderAfterTag() RenderAfterTag()

寫入標記項目的結尾標記之後所發生的任何間距或文字。Writes any spacing or text that occurs after the closing tag for a markup element.

(Inherited from HtmlTextWriter)
RenderBeforeContent() RenderBeforeContent() RenderBeforeContent() RenderBeforeContent()

在標記項目的內容之前及開頭標記之後寫入任何文字或間距。Writes any text or spacing before the content and after the opening tag of a markup element.

(Inherited from HtmlTextWriter)
RenderBeforeTag() RenderBeforeTag() RenderBeforeTag() RenderBeforeTag()

寫入標記項目的開頭標記之前所發生的任何文字或間距。Writes any text or spacing that occurs before the opening tag of a markup element.

(Inherited from HtmlTextWriter)
RenderBeginTag(HtmlTextWriterTag) RenderBeginTag(HtmlTextWriterTag) RenderBeginTag(HtmlTextWriterTag) RenderBeginTag(HtmlTextWriterTag)

將與指定的 HtmlTextWriterTag 列舉值相關聯的標記項目的開頭標記寫入輸出資料流中。Writes the opening tag of the markup element associated with the specified HtmlTextWriterTag enumeration value to the output stream.

(Inherited from HtmlTextWriter)
RenderBeginTag(String) RenderBeginTag(String) RenderBeginTag(String) RenderBeginTag(String)

將指定標記項目的開頭標記寫入到輸出資料流。Writes the opening tag of the specified markup element to the output stream.

(Inherited from HtmlTextWriter)
RenderEndTag() RenderEndTag() RenderEndTag() RenderEndTag()

將標記項目的結尾標記寫入輸出資料流中。Writes the end tag of a markup element to the output stream.

(Inherited from HtmlTextWriter)
SetDocType(XhtmlMobileDocType) SetDocType(XhtmlMobileDocType) SetDocType(XhtmlMobileDocType) SetDocType(XhtmlMobileDocType)

指定文字寫入器的 XHTML 文件類型,以便於頁面或控制項中呈現。Specifies the XHTML document type for the text writer to render to the page or control.

ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)
Write(Boolean) Write(Boolean) Write(Boolean) Write(Boolean)

將布林值的文字表示以及任何暫止定位空格寫入輸出資料流。Writes the text representation of a Boolean value to the output stream, along with any pending tab spacing.

(Inherited from HtmlTextWriter)
Write(Char) Write(Char) Write(Char) Write(Char)

將 Unicode 字元的文字表示以及任何暫止定位空格寫入輸出資料流。Writes the text representation of a Unicode character to the output stream, along with any pending tab spacing.

(Inherited from HtmlTextWriter)
Write(Char[]) Write(Char[]) Write(Char[]) Write(Char[])

將 Unicode 字元陣列的文字表示以及任何暫止定位空格寫入輸出資料流。Writes the text representation of an array of Unicode characters to the output stream, along with any pending tab spacing.

(Inherited from HtmlTextWriter)
Write(Char[], Int32, Int32) Write(Char[], Int32, Int32) Write(Char[], Int32, Int32) Write(Char[], Int32, Int32)

將 Unicode 字元子陣列的文字表示以及任何暫止定位空格寫入輸出資料流。Writes the text representation of a subarray of Unicode characters to the output stream, along with any pending tab spacing.

(Inherited from HtmlTextWriter)
Write(Decimal) Write(Decimal) Write(Decimal) Write(Decimal)

將十進位值的文字表示寫入文字資料流。Writes the text representation of a decimal value to the text stream.

(Inherited from TextWriter)
Write(Double) Write(Double) Write(Double) Write(Double)

將雙精度浮點數的文字表示以及任何暫止定位空格寫入輸出資料流。Writes the text representation of a double-precision floating-point number to the output stream, along with any pending tab spacing.

(Inherited from HtmlTextWriter)
Write(Int32) Write(Int32) Write(Int32) Write(Int32)

將 32 位元組帶正負數的整數之文字表示以及任何暫止定位空格寫入輸出資料流。Writes the text representation of a 32-byte signed integer to the output stream, along with any pending tab spacing.

(Inherited from HtmlTextWriter)
Write(Int64) Write(Int64) Write(Int64) Write(Int64)

將 64 位元組帶正負數的整數之文字表示以及任何暫止定位空格寫入輸出資料流。Writes the text representation of a 64-byte signed integer to the output stream, along with any pending tab spacing.

(Inherited from HtmlTextWriter)
Write(Object) Write(Object) Write(Object) Write(Object)

將物件的文字表示以及任何暫止定位空格寫入輸出資料流。Writes the text representation of an object to the output stream, along with any pending tab spacing.

(Inherited from HtmlTextWriter)
Write(ReadOnlySpan<Char>) Write(ReadOnlySpan<Char>) Write(ReadOnlySpan<Char>) Write(ReadOnlySpan<Char>)

將字元範圍寫入文字資料流。Writes a character span to the text stream.

(Inherited from TextWriter)
Write(Single) Write(Single) Write(Single) Write(Single)

將單精確度浮點數的文字表示以及任何暫止定位空格寫入輸出資料流。Writes the text representation of a single-precision floating-point number to the output stream, along with any pending tab spacing.

(Inherited from HtmlTextWriter)
Write(String) Write(String) Write(String) Write(String)

將指定字串以及任何暫止定位空格寫入輸出資料流。Writes the specified string to the output stream, along with any pending tab spacing.

(Inherited from HtmlTextWriter)
Write(String, Object) Write(String, Object) Write(String, Object) Write(String, Object)

將定位字串和已格式化的字串寫入輸出資料流,使用與 Format(String, Object) 方法相同的語意。Writes a tab string and a formatted string to the output stream, using the same semantics as the Format(String, Object) method, along with any pending tab spacing.

(Inherited from HtmlTextWriter)
Write(String, Object, Object) Write(String, Object, Object) Write(String, Object, Object) Write(String, Object, Object)

將格式化字串 (其中包含兩個物件的文字表示) 以及任何暫止定位空格寫入輸出資料流。Writes a formatted string that contains the text representation of two objects to the output stream, along with any pending tab spacing. 這個方法使用的語意與 Format(String, Object, Object) 方法相同。This method uses the same semantics as the Format(String, Object, Object) method.

(Inherited from HtmlTextWriter)
Write(String, Object, Object, Object) Write(String, Object, Object, Object) Write(String, Object, Object, Object) Write(String, Object, Object, Object)

使用與 Format(String, Object, Object, Object) 方法相同的語意,將格式化字串寫入文字資料流。Writes a formatted string to the text stream, using the same semantics as the Format(String, Object, Object, Object) method.

(Inherited from TextWriter)
Write(String, Object[]) Write(String, Object[]) Write(String, Object[]) Write(String, Object[])

將格式化字串 (其中包含物件陣列的文字表示) 以及任何暫止定位空格寫入輸出資料流。Writes a formatted string that contains the text representation of an object array to the output stream, along with any pending tab spacing. 這個方法使用的語意與 Format(String, Object[]) 方法相同。This method uses the same semantics as the Format(String, Object[]) method.

(Inherited from HtmlTextWriter)
Write(StringBuilder) Write(StringBuilder) Write(StringBuilder) Write(StringBuilder)

將字串產生器寫入文字資料流。Writes a string builder to the text stream.

(Inherited from TextWriter)
Write(UInt32) Write(UInt32) Write(UInt32) Write(UInt32)

將 4 位元組不帶正負號的整數文字表示寫入文字資料流。Writes the text representation of a 4-byte unsigned integer to the text stream.

(Inherited from TextWriter)
Write(UInt64) Write(UInt64) Write(UInt64) Write(UInt64)

將 8 位元組帶不正負號的整數文字表示寫入文字資料流。Writes the text representation of an 8-byte unsigned integer to the text stream.

(Inherited from TextWriter)
WriteAsync(Char) WriteAsync(Char) WriteAsync(Char) WriteAsync(Char)

以非同步方式將字元寫入文字資料流。Writes a character to the text stream asynchronously.

(Inherited from TextWriter)
WriteAsync(Char[]) WriteAsync(Char[]) WriteAsync(Char[]) WriteAsync(Char[])

以非同步方式將字元陣列寫入文字資料流。Writes a character array to the text stream asynchronously.

(Inherited from TextWriter)
WriteAsync(Char[], Int32, Int32) WriteAsync(Char[], Int32, Int32) WriteAsync(Char[], Int32, Int32) WriteAsync(Char[], Int32, Int32)

以非同步方式將字元的子陣列寫入文字資料流。Writes a subarray of characters to the text stream asynchronously.

(Inherited from TextWriter)
WriteAsync(ReadOnlyMemory<Char>, CancellationToken) WriteAsync(ReadOnlyMemory<Char>, CancellationToken) WriteAsync(ReadOnlyMemory<Char>, CancellationToken) WriteAsync(ReadOnlyMemory<Char>, CancellationToken)

以非同步方式將字元記憶體區域寫入文字資料流。Asynchronously writes a character memory region to the text stream.

(Inherited from TextWriter)
WriteAsync(String) WriteAsync(String) WriteAsync(String) WriteAsync(String)

以非同步方式將字串寫入至文字資料流。Writes a string to the text stream asynchronously.

(Inherited from TextWriter)
WriteAsync(StringBuilder, CancellationToken) WriteAsync(StringBuilder, CancellationToken) WriteAsync(StringBuilder, CancellationToken) WriteAsync(StringBuilder, CancellationToken)

以非同步方式將字串產生器寫入文字資料流。Asynchronously writes a string builder to the text stream.

(Inherited from TextWriter)
WriteAttribute(String, String) WriteAttribute(String, String) WriteAttribute(String, String) WriteAttribute(String, String)

將指定的標記屬性和值寫入輸出資料流中。Writes the specified markup attribute and value to the output stream.

(Inherited from HtmlTextWriter)
WriteAttribute(String, String, Boolean) WriteAttribute(String, String, Boolean) WriteAttribute(String, String, Boolean) WriteAttribute(String, String, Boolean)

將指定的標記屬性和值寫入輸出資料流,並在指定時寫入編碼值。Writes the specified markup attribute and value to the output stream, and, if specified, writes the value encoded.

(Inherited from HtmlTextWriter)
WriteBeginTag(String) WriteBeginTag(String) WriteBeginTag(String) WriteBeginTag(String)

將指定標記項目的任何定位間距和開頭標記,寫入至輸出資料流中。Writes any tab spacing and the opening tag of the specified markup element to the output stream.

(Inherited from HtmlTextWriter)
WriteBreak() WriteBreak() WriteBreak() WriteBreak()

<br/> 項目寫入至 XHTML 輸出資料流。Writes a <br/> element to the XHTML output stream.

WriteEncodedText(String) WriteEncodedText(String) WriteEncodedText(String) WriteEncodedText(String)

為要求的裝置編碼指定的文字,然後將其寫入輸出資料流。Encodes the specified text for the requesting device, and then writes it to the output stream.

(Inherited from HtmlTextWriter)
WriteEncodedUrl(String) WriteEncodedUrl(String) WriteEncodedUrl(String) WriteEncodedUrl(String)

為指定的 URL 編碼,然後將其寫入輸出資料流。Encodes the specified URL, and then writes it to the output stream. URL 可能包含參數。The URL might include parameters.

(Inherited from HtmlTextWriter)
WriteEncodedUrlParameter(String) WriteEncodedUrlParameter(String) WriteEncodedUrlParameter(String) WriteEncodedUrlParameter(String)

針對要求裝置為指定的 URL 參數編碼,然後將此 URL 寫入輸出資料流中。Encodes the specified URL parameter for the requesting device, and then writes it to the output stream.

(Inherited from HtmlTextWriter)
WriteEndTag(String) WriteEndTag(String) WriteEndTag(String) WriteEndTag(String)

寫入指定標記項目的任何定位空格和結尾標記。Writes any tab spacing and the closing tag of the specified markup element.

(Inherited from HtmlTextWriter)
WriteFullBeginTag(String) WriteFullBeginTag(String) WriteFullBeginTag(String) WriteFullBeginTag(String)

將指定標記項目的任何定位間距和開頭標記,寫入至輸出資料流中。Writes any tab spacing and the opening tag of the specified markup element to the output stream.

(Inherited from HtmlTextWriter)
WriteLine() WriteLine() WriteLine() WriteLine()

將行結束字元字串寫入輸出資料流中。Writes a line terminator string to the output stream.

(Inherited from HtmlTextWriter)
WriteLine(Boolean) WriteLine(Boolean) WriteLine(Boolean) WriteLine(Boolean)

將任何暫止定位空格及布林值的文字表示 (後面接著行結束字元字串) 寫入輸出資料流中。Writes any pending tab spacing and the text representation of a Boolean value, followed by a line terminator string, to the output stream.

(Inherited from HtmlTextWriter)
WriteLine(Char) WriteLine(Char) WriteLine(Char) WriteLine(Char)

將任何暫止定位空格及 Unicode 字元 (後面接著行結束字元字串) 寫入輸出資料流中。Writes any pending tab spacing and a Unicode character, followed by a line terminator string, to the output stream.

(Inherited from HtmlTextWriter)
WriteLine(Char[]) WriteLine(Char[]) WriteLine(Char[]) WriteLine(Char[])

將任何暫止定位空格及 Unicode 字元的陣列 (後面接著行結束字元字串) 寫入輸出資料流中。Writes any pending tab spacing and an array of Unicode characters, followed by a line terminator string, to the output stream.

(Inherited from HtmlTextWriter)
WriteLine(Char[], Int32, Int32) WriteLine(Char[], Int32, Int32) WriteLine(Char[], Int32, Int32) WriteLine(Char[], Int32, Int32)

將任何暫止定位空格及 Unicode 字元的子陣列 (後面接著行結束字元字串) 寫入輸出資料流中。Writes any pending tab spacing and a subarray of Unicode characters, followed by a line terminator string, to the output stream.

(Inherited from HtmlTextWriter)
WriteLine(Decimal) WriteLine(Decimal) WriteLine(Decimal) WriteLine(Decimal)

將十進位值的文字表示寫入文字資料流,後接行結束字元。Writes the text representation of a decimal value to the text stream, followed by a line terminator.

(Inherited from TextWriter)
WriteLine(Double) WriteLine(Double) WriteLine(Double) WriteLine(Double)

將任何暫止定位空格及雙精度浮點數的文字表示 (後面接著行結束字元字串) 寫入輸出資料流中。Writes any pending tab spacing and the text representation of a double-precision floating-point number, followed by a line terminator string, to the output stream.

(Inherited from HtmlTextWriter)
WriteLine(Int32) WriteLine(Int32) WriteLine(Int32) WriteLine(Int32)

將任何暫止定位空格及 32 位元組帶正負號整數的文字表示 (後面接著行結束字元字串) 寫入輸出資料流中。Writes any pending tab spacing and the text representation of a 32-byte signed integer, followed by a line terminator string, to the output stream.

(Inherited from HtmlTextWriter)
WriteLine(Int64) WriteLine(Int64) WriteLine(Int64) WriteLine(Int64)

將任何暫止定位空格及 64 位元組帶正負號整數的文字表示 (後面接著行結束字元字串) 寫入輸出資料流中。Writes any pending tab spacing and the text representation of a 64-byte signed integer, followed by a line terminator string, to the output stream.

(Inherited from HtmlTextWriter)
WriteLine(Object) WriteLine(Object) WriteLine(Object) WriteLine(Object)

將任何暫止定位空格及物件的文字表示 (後面接著行結束字元字串) 寫入輸出資料流中。Writes any pending tab spacing and the text representation of an object, followed by a line terminator string, to the output stream.

(Inherited from HtmlTextWriter)
WriteLine(ReadOnlySpan<Char>) WriteLine(ReadOnlySpan<Char>) WriteLine(ReadOnlySpan<Char>) WriteLine(ReadOnlySpan<Char>)

將字元範圍的文字表示寫入文字資料流,後接行結束字元。Writes the text representation of a character span to the text stream, followed by a line terminator.

(Inherited from TextWriter)
WriteLine(Single) WriteLine(Single) WriteLine(Single) WriteLine(Single)

將任何暫止定位空格及單精確度浮點數的文字表示 (後面接著行結束字元字串) 寫入輸出資料流中。Writes any pending tab spacing and the text representation of a single-precision floating-point number, followed by a line terminator string, to the output stream.

(Inherited from HtmlTextWriter)
WriteLine(String) WriteLine(String) WriteLine(String) WriteLine(String)

將任何暫止定位空格及文字字串 (後面接著行結束字元字串) 寫入輸出資料流中。Writes any pending tab spacing and a text string, followed by a line terminator string, to the output stream.

(Inherited from HtmlTextWriter)
WriteLine(String, Object) WriteLine(String, Object) WriteLine(String, Object) WriteLine(String, Object)

將任何暫止定位空格及包含物件之文字表示的格式化字串 (後面接著行結束字元字串) 寫入輸出資料流中。Writes any pending tab spacing and a formatted string containing the text representation of an object, followed by a line terminator string, to the output stream.

(Inherited from HtmlTextWriter)
WriteLine(String, Object, Object) WriteLine(String, Object, Object) WriteLine(String, Object, Object) WriteLine(String, Object, Object)

將任何暫止定位空格及包含兩個物件的文字表示之格式化字串 (後面接著行結束字元字串) 寫入輸出資料流中。Writes any pending tab spacing and a formatted string that contains the text representation of two objects, followed by a line terminator string, to the output stream.

(Inherited from HtmlTextWriter)
WriteLine(String, Object, Object, Object) WriteLine(String, Object, Object, Object) WriteLine(String, Object, Object, Object) WriteLine(String, Object, Object, Object)

使用與 Format(String, Object) 相同的語意,寫出文字資料流中的格式化字串和新行。Writes out a formatted string and a new line to the text stream, using the same semantics as Format(String, Object).

(Inherited from TextWriter)
WriteLine(String, Object[]) WriteLine(String, Object[]) WriteLine(String, Object[]) WriteLine(String, Object[])

將任何暫止定位空格及包含物件陣列的文字表示之格式化字串 (後面接著行結束字元字串) 寫入輸出資料流中。Writes any pending tab spacing and a formatted string that contains the text representation of an object array, followed by a line terminator string, to the output stream.

(Inherited from HtmlTextWriter)
WriteLine(StringBuilder) WriteLine(StringBuilder) WriteLine(StringBuilder) WriteLine(StringBuilder)

將字串產生器的文字表示寫入文字資料流,後接行結束字元。Writes the text representation of a string builder to the text stream, followed by a line terminator.

(Inherited from TextWriter)
WriteLine(UInt32) WriteLine(UInt32) WriteLine(UInt32) WriteLine(UInt32)

將任何暫止定位空格及 4 位元組、不帶正負號整數的文字表示 (後面接著行結束字元字串) 寫入輸出資料流中。Writes any pending tab spacing and the text representation of a 4-byte unsigned integer, followed by a line terminator string, to the output stream.

(Inherited from HtmlTextWriter)
WriteLine(UInt64) WriteLine(UInt64) WriteLine(UInt64) WriteLine(UInt64)

將 8 位元組不帶正負號的整數文字表示寫入文字資料流,後接行結束字元。Writes the text representation of an 8-byte unsigned integer to the text stream, followed by a line terminator.

(Inherited from TextWriter)
WriteLineAsync() WriteLineAsync() WriteLineAsync() WriteLineAsync()

以非同步方式將行結束字元寫入文字資料流。Asynchronously writes a line terminator to the text stream.

(Inherited from TextWriter)
WriteLineAsync(Char) WriteLineAsync(Char) WriteLineAsync(Char) WriteLineAsync(Char)

以非同步方式將字元寫入文字資料流,後接行結束字元。Asynchronously writes a character to the text stream, followed by a line terminator.

(Inherited from TextWriter)
WriteLineAsync(Char[]) WriteLineAsync(Char[]) WriteLineAsync(Char[]) WriteLineAsync(Char[])

以非同步方式將字元的陣列寫入文字資料流,後接行結束字元。Asynchronously writes an array of characters to the text stream, followed by a line terminator.

(Inherited from TextWriter)
WriteLineAsync(Char[], Int32, Int32) WriteLineAsync(Char[], Int32, Int32) WriteLineAsync(Char[], Int32, Int32) WriteLineAsync(Char[], Int32, Int32)

以非同步方式將字元的子陣列寫入文字資料流,後接行結束字元。Asynchronously writes a subarray of characters to the text stream, followed by a line terminator.

(Inherited from TextWriter)
WriteLineAsync(ReadOnlyMemory<Char>, CancellationToken) WriteLineAsync(ReadOnlyMemory<Char>, CancellationToken) WriteLineAsync(ReadOnlyMemory<Char>, CancellationToken) WriteLineAsync(ReadOnlyMemory<Char>, CancellationToken)

以非同步方式將字元記憶體區域的文字表示寫入文字資料流,後接行結束字元。Asynchronously writes the text representation of a character memory region to the text stream, followed by a line terminator.

(Inherited from TextWriter)
WriteLineAsync(String) WriteLineAsync(String) WriteLineAsync(String) WriteLineAsync(String)

以非同步方式將字串寫入文字資料流,後接行結束字元。Asynchronously writes a string to the text stream, followed by a line terminator.

(Inherited from TextWriter)
WriteLineAsync(StringBuilder, CancellationToken) WriteLineAsync(StringBuilder, CancellationToken) WriteLineAsync(StringBuilder, CancellationToken) WriteLineAsync(StringBuilder, CancellationToken)

以非同步方式將字串產生器的文字表示寫入文字資料流,後接行結束字元。Asynchronously writes the text representation of a string builder to the text stream, followed by a line terminator.

(Inherited from TextWriter)
WriteLineNoTabs(String) WriteLineNoTabs(String) WriteLineNoTabs(String) WriteLineNoTabs(String)

將字串 (後面接著行結束字元字串) 寫入輸出資料流中。Writes a string, followed by a line terminator string, to the output stream. 這個方法忽略任何指定的定位空格。This method ignores any specified tab spacing.

(Inherited from HtmlTextWriter)
WriteStyleAttribute(String, String) WriteStyleAttribute(String, String) WriteStyleAttribute(String, String) WriteStyleAttribute(String, String)

將指定的樣式屬性寫入輸出資料流中。Writes the specified style attribute to the output stream.

(Inherited from HtmlTextWriter)
WriteStyleAttribute(String, String, Boolean) WriteStyleAttribute(String, String, Boolean) WriteStyleAttribute(String, String, Boolean) WriteStyleAttribute(String, String, Boolean)

將指定的樣式屬性和屬性值寫入輸出資料流中,並在指定時為該值編碼。Writes the specified style attribute and value to the output stream, and encodes the value, if specified.

(Inherited from HtmlTextWriter)
WriteUrlEncodedString(String, Boolean) WriteUrlEncodedString(String, Boolean) WriteUrlEncodedString(String, Boolean) WriteUrlEncodedString(String, Boolean)

寫入指定的字串,並根據 URL 需求來為此字串編碼。Writes the specified string, encoding it according to URL requirements.

(Inherited from HtmlTextWriter)

欄位

CoreNewLine CoreNewLine CoreNewLine CoreNewLine

儲存這個 TextWriter 所使用的新行字元。Stores the newline characters used for this TextWriter.

(Inherited from TextWriter)
DefaultTabString DefaultTabString DefaultTabString DefaultTabString

表示單一定位字元。Represents a single tab character.

(Inherited from HtmlTextWriter)
DoubleQuoteChar DoubleQuoteChar DoubleQuoteChar DoubleQuoteChar

表示引號 (") 字元。Represents the quotation mark (") character.

(Inherited from HtmlTextWriter)
EndTagLeftChars EndTagLeftChars EndTagLeftChars EndTagLeftChars

表示標記項目結尾標記的左角括弧和斜線符號 (</)。Represents the left angle bracket and slash mark (</) of the closing tag of a markup element.

(Inherited from HtmlTextWriter)
EqualsChar EqualsChar EqualsChar EqualsChar

表示等號 (=)。Represents the equal sign (=).

(Inherited from HtmlTextWriter)
EqualsDoubleQuoteString EqualsDoubleQuoteString EqualsDoubleQuoteString EqualsDoubleQuoteString

表示組成字串 (=") 的等號 (=) 和雙引號 (")。Represents an equal sign (=) and a double quotation mark (") together in a string (=").

(Inherited from HtmlTextWriter)
SelfClosingChars SelfClosingChars SelfClosingChars SelfClosingChars

表示空格以及標記的自行結尾斜線符號 (/)。Represents a space and the self-closing slash mark (/) of a markup tag.

(Inherited from HtmlTextWriter)
SelfClosingTagEnd SelfClosingTagEnd SelfClosingTagEnd SelfClosingTagEnd

表示自我結尾標記項目的結尾斜線符號和右角括弧 (/>)。Represents the closing slash mark and right angle bracket (/>) of a self-closing markup element.

(Inherited from HtmlTextWriter)
SemicolonChar SemicolonChar SemicolonChar SemicolonChar

表示分號 (;)。Represents the semicolon (;).

(Inherited from HtmlTextWriter)
SingleQuoteChar SingleQuoteChar SingleQuoteChar SingleQuoteChar

表示所有格符號 (')。Represents an apostrophe (').

(Inherited from HtmlTextWriter)
SlashChar SlashChar SlashChar SlashChar

表示斜線符號 (/)。Represents the slash mark (/).

(Inherited from HtmlTextWriter)
SpaceChar SpaceChar SpaceChar SpaceChar

表示空格 ( ) 字元。Represents a space ( ) character.

(Inherited from HtmlTextWriter)
StyleEqualsChar StyleEqualsChar StyleEqualsChar StyleEqualsChar

表示樣式等號 (:) 字元,此字元用來設定樣式屬性等於值。Represents the style equals (:) character used to set style attributes equal to values.

(Inherited from HtmlTextWriter)
TagLeftChar TagLeftChar TagLeftChar TagLeftChar

表示標記的開頭角括弧 (<)。Represents the opening angle bracket (<) of a markup tag.

(Inherited from HtmlTextWriter)
TagRightChar TagRightChar TagRightChar TagRightChar

表示標記的結尾角括弧 (>)。Represents the closing angle bracket (>) of a markup tag.

(Inherited from HtmlTextWriter)

明確介面實作

IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose()

如需這個成員的說明,請參閱 Dispose()For a description of this member, see Dispose().

(Inherited from TextWriter)

適用於

另請參閱