XhtmlTextWriter 类

定义

将特定于可扩展超文本标记语言 (XHTML) 的字符(包括从 XHTML 派生的 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

下面的代码示例演示如何创建名为 TestLabel 的自定义 Label 控件和名为 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 网页上使用自定义控件 TestLabelThe 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 是一种基于 XML 的标记语言,基于 HTML 4.1,使你能够创建适用于多个设备类型的网站。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 类提供 ASP.NET 服务器控件在向客户端呈现 XHTML 内容时使用的格式设置功能。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 中的 XHTML 标准和 ASP.NETFor more information, see XHTML Standards in Visual Studio and ASP.NET.

除非将 ASP.NET 专门配置为不呈现 XHTML 标记,否则 HtmlTextWriter 输出 XHTML。The HtmlTextWriter outputs XHTML unless you configure ASP.NET specifically to not render XHTML markup. 有关详细信息,请参阅如何:在 ASP.NET 网站中配置 XHTML 呈现。For more information, see How to: Configure XHTML Rendering in ASP.NET Web Sites.

构造函数

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 类的新实例。Initializes a new instance of the XhtmlTextWriter class with the specified line indentation.

字段

CoreNewLine

存储用于此 TextWriter 的换行符。Stores the newline characters used for this TextWriter.

(继承自 TextWriter)
DefaultTabString

表示单个制表符。Represents a single tab character.

(继承自 HtmlTextWriter)
DoubleQuoteChar

表示引号 (") 字符。Represents the quotation mark (") character.

(继承自 HtmlTextWriter)
EndTagLeftChars

表示标记元素结束标记的左尖括号和斜线 (</)。Represents the left angle bracket and slash mark (</) of the closing tag of a markup element.

(继承自 HtmlTextWriter)
EqualsChar

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

(继承自 HtmlTextWriter)
EqualsDoubleQuoteString

表示字符串 (=") 中合并在一起的等号 (=) 和双引号 (")。Represents an equal sign (=) and a double quotation mark (") together in a string (=").

(继承自 HtmlTextWriter)
SelfClosingChars

表示空格和标记的自结束斜杠 (/)。Represents a space and the self-closing slash mark (/) of a markup tag.

(继承自 HtmlTextWriter)
SelfClosingTagEnd

表示自结束标记元素的右斜杠标记和右尖括号 (/>)。Represents the closing slash mark and right angle bracket (/>) of a self-closing markup element.

(继承自 HtmlTextWriter)
SemicolonChar

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

(继承自 HtmlTextWriter)
SingleQuoteChar

表示撇号 (')。Represents an apostrophe (').

(继承自 HtmlTextWriter)
SlashChar

表示斜杠 (/)。Represents the slash mark (/).

(继承自 HtmlTextWriter)
SpaceChar

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

(继承自 HtmlTextWriter)
StyleEqualsChar

表示用于将样式属性设置为等于值的样式等号 (:) 字符。Represents the style equals (:) character used to set style attributes equal to values.

(继承自 HtmlTextWriter)
TagLeftChar

表示标记标签的左尖括号 (<)。Represents the opening angle bracket (<) of a markup tag.

(继承自 HtmlTextWriter)
TagRightChar

表示标记标签的右尖括号 (>)。Represents the closing angle bracket (>) of a markup tag.

(继承自 HtmlTextWriter)

属性

CommonAttributes

获取 Hashtable 对象,该对象包含 XhtmlTextWriter 对象的加价标记的公共特性。Gets a Hashtable object containing common attributes of the markup tags for the XhtmlTextWriter object.

ElementSpecificAttributes

获取一个包含特定于元素的特性的 Hashtable 对象。Gets a Hashtable object containing element-specific attributes.

Encoding

获取 HtmlTextWriter 对象用于将内容写入页面的编码。Gets the encoding that the HtmlTextWriter object uses to write content to the page.

(继承自 HtmlTextWriter)
FormatProvider

获取控制格式设置的对象。Gets an object that controls formatting.

(继承自 TextWriter)
Indent

获取或设置用以缩进每一行标记的开始位置的制表符位置数。Gets or sets the number of tab positions to indent the beginning of each line of markup.

(继承自 HtmlTextWriter)
InnerWriter

获取或设置写入标记元素内部内容的文本编写器。Gets or sets the text writer that writes the inner content of the markup element.

(继承自 HtmlTextWriter)
NewLine

获取或设置 HtmlTextWriter 对象使用的行结束符字符串。Gets or sets the line terminator string used by the HtmlTextWriter object.

(继承自 HtmlTextWriter)
SuppressCommonAttributes

获取由取消了 CommonAttributes 特性的元素组成的 Hashtable 对象。Gets a Hashtable object of elements for which CommonAttributes attributes are suppressed.

TagKey

获取或设置指定标记元素的 HtmlTextWriterTag 值。Gets or sets the HtmlTextWriterTag value for the specified markup element.

(继承自 HtmlTextWriter)
TagName

获取或设置所呈现的标记元素的标记名称。Gets or sets the tag name of the markup element being rendered.

(继承自 HtmlTextWriter)

方法

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.

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
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)

对于通过对 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.

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
BeginRender()

通知 HtmlTextWriter 对象或派生类的对象,将会呈现某个控件。Notifies an HtmlTextWriter object, or an object of a derived class, that a control is about to be rendered.

(继承自 HtmlTextWriter)
Close()

关闭 HtmlTextWriter 对象并释放与之关联的所有系统资源。Closes the HtmlTextWriter object and releases any system resources associated with it.

(继承自 HtmlTextWriter)
CreateObjRef(Type)

创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(继承自 MarshalByRefObject)
Dispose()

释放 TextWriter 对象使用的所有资源。Releases all resources used by the TextWriter object.

(继承自 TextWriter)
Dispose(Boolean)

释放 TextWriter 使用的非托管资源并选择性地释放托管资源。Releases the unmanaged resources used by the TextWriter and optionally releases the managed resources.

(继承自 TextWriter)
DisposeAsync()

异步释放由 TextWriter 对象使用的所有资源。Asynchronously releases all resources used by the TextWriter object.

(继承自 TextWriter)
EncodeAttributeValue(HtmlTextWriterAttribute, String)

根据当前上下文的 HttpRequest 对象的要求,对指定标记特性的值进行编码。Encodes the value of the specified markup attribute based on the requirements of the HttpRequest object of the current context.

(继承自 HtmlTextWriter)
EncodeAttributeValue(String, Boolean)

根据当前上下文的 HttpRequest 对象的要求,对指定标记特性的值进行编码。Encodes the value of the specified markup attribute based on the requirements of the HttpRequest object of the current context.

(继承自 HtmlTextWriter)
EncodeUrl(String)

通过将指定的 URL 中的空格转换为字符串“%20”,以执行最小 URL 编码。Performs minimal URL encoding by converting spaces in the specified URL to the string "%20".

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
ExitStyle(Style)

写入 <span> 元素的结束标记以结束指定的布局和字符格式设置。Writes the closing tag of a <span> element to end the specified layout and character formatting.

(继承自 HtmlTextWriter)
ExitStyle(Style, HtmlTextWriterTag)

写入指定的标记元素的结束标记,以结束指定的布局和字符格式。Writes the closing tag of the specified markup element to end the specified layout and character formatting.

(继承自 HtmlTextWriter)
FilterAttributes()

移除页面或 Web 服务器控件的所有属性上的所有标记和样式属性。Removes all the markup and style attributes on all properties of the page or Web server control.

(继承自 HtmlTextWriter)
Flush()

清理当前 HtmlTextWriter 对象的所有缓冲区并使所有缓冲数据写入到输出流。Clears all buffers for the current HtmlTextWriter object and causes any buffered data to be written to the output stream.

(继承自 HtmlTextWriter)
FlushAsync()

异步清理当前编写器的所有缓冲区,使所有缓冲数据写入基础设备。Asynchronously clears all buffers for the current writer and causes any buffered data to be written to the underlying device.

(继承自 TextWriter)
GetAttributeKey(String)

获取指定属性的相应 HtmlTextWriterAttribute 枚举值。Obtains the corresponding HtmlTextWriterAttribute enumeration value for the specified attribute.

(继承自 HtmlTextWriter)
GetAttributeName(HtmlTextWriterAttribute)

获取与指定的 HtmlTextWriterAttribute 值关联的标记属性名称。Obtains the name of the markup attribute associated with the specified HtmlTextWriterAttribute value.

(继承自 HtmlTextWriter)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetLifetimeService()

检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(继承自 MarshalByRefObject)
GetStyleKey(String)

获取指定样式的 HtmlTextWriterStyle 枚举值。Obtains the HtmlTextWriterStyle enumeration value for the specified style.

(继承自 HtmlTextWriter)
GetStyleName(HtmlTextWriterStyle)

获取与指定的 HtmlTextWriterStyle 枚举值关联的标记样式属性名称。Obtains the markup style attribute name associated with the specified HtmlTextWriterStyle enumeration value.

(继承自 HtmlTextWriter)
GetTagKey(String)

获取与指定标记元素关联的 HtmlTextWriterTag 枚举值。Obtains the HtmlTextWriterTag enumeration value associated with the specified markup element.

(继承自 HtmlTextWriter)
GetTagName(HtmlTextWriterTag)

获取与指定的 HtmlTextWriterTag 枚举值关联的标记元素。Obtains the markup element associated with the specified HtmlTextWriterTag enumeration value.

(继承自 HtmlTextWriter)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
InitializeLifetimeService()

获取生存期服务对象来控制此实例的生存期策略。Obtains a lifetime service object to control the lifetime policy for this instance.

(继承自 MarshalByRefObject)
IsAttributeDefined(HtmlTextWriterAttribute)

确定是否在下一次调用 RenderBeginTag 方法时呈现指定的标记属性及其值。Determines whether the specified markup attribute and its value are rendered during the next call to the RenderBeginTag method.

(继承自 HtmlTextWriter)
IsAttributeDefined(HtmlTextWriterAttribute, String)

确定是否在下一次调用 RenderBeginTag 方法时呈现指定的标记属性及其值。Determines whether the specified markup attribute and its value are rendered during the next call to the RenderBeginTag method.

(继承自 HtmlTextWriter)
IsStyleAttributeDefined(HtmlTextWriterStyle)

确定下次调用 RenderBeginTag 方法时指定的标记样式属性是否呈现。Determines whether the specified markup style attribute is rendered during the next call to the RenderBeginTag method.

(继承自 HtmlTextWriter)
IsStyleAttributeDefined(HtmlTextWriterStyle, String)

确定下次调用 RenderBeginTag 方法时是否呈现指定的标记样式属性及其值。Determines whether the specified markup style attribute and its value are rendered during the next call to the RenderBeginTag method.

(继承自 HtmlTextWriter)
IsValidFormAttribute(String)

检查一个 XHTML 特性以确保它可以在 <form> 元素的开始标记中呈现。Checks an XHTML attribute to ensure that it can be rendered in the opening tag of a <form> element.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
MemberwiseClone(Boolean)

创建当前 MarshalByRefObject 对象的浅表副本。Creates a shallow copy of the current MarshalByRefObject object.

(继承自 MarshalByRefObject)
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)

确定是否可以将指定的 XHTML 样式特性及其值呈现给当前的标记元素。Determines whether the specified XHTML style attribute and its value can be rendered to the current markup element.

OnTagRender(String, HtmlTextWriterTag)

确定是否向请求页面呈现指定的标记元素。Determines whether the specified markup element will be rendered to the requesting page.

(继承自 HtmlTextWriter)
OutputTabs()

写入一连串用以表示标记字符行的缩进级别的制表符字符串。Writes a series of tab strings that represent the indentation level for a line of markup characters.

(继承自 HtmlTextWriter)
PopEndTag()

从呈现的元素列表中移除最近保存的标记元素。Removes the most recently saved markup element from the list of rendered elements.

(继承自 HtmlTextWriter)
PushEndTag(String)

为标记元素生成结束标记时,保存指定的标记元素供以后使用。Saves the specified markup element for later use when generating the end tag for a markup element.

(继承自 HtmlTextWriter)
RemoveRecognizedAttribute(String, String)

从元素的 ElementSpecificAttributes 集合移除一个特性。Removes an attribute from the ElementSpecificAttributes collection of an element.

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.

(继承自 HtmlTextWriter)
RenderAfterTag()

写入在标记元素的结束标记后出现的任何间距或文本。Writes any spacing or text that occurs after the closing tag for a markup element.

(继承自 HtmlTextWriter)
RenderBeforeContent()

在标记元素的内容之前、开始标记之后写入任何文本或间距。Writes any text or spacing before the content and after the opening tag of a markup element.

(继承自 HtmlTextWriter)
RenderBeforeTag()

写入在标记元素的开始标记之前出现的任何文本或间距。Writes any text or spacing that occurs before the opening tag of a markup element.

(继承自 HtmlTextWriter)
RenderBeginTag(HtmlTextWriterTag)

将与指定的 HtmlTextWriterTag 枚举值关联的标记元素的开始标记写入到输出流。Writes the opening tag of the markup element associated with the specified HtmlTextWriterTag enumeration value to the output stream.

(继承自 HtmlTextWriter)
RenderBeginTag(String)

将指定标记元素的开始标记写入输出流。Writes the opening tag of the specified markup element to the output stream.

(继承自 HtmlTextWriter)
RenderEndTag()

将标记元素的结束标记写入输出流。Writes the end tag of a markup element to the output stream.

(继承自 HtmlTextWriter)
SetDocType(XhtmlMobileDocType)

指定文本编写器要呈现到页或控件的 XHTML 文档类型。Specifies the XHTML document type for the text writer to render to the page or control.

ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
Write(Boolean)

将布尔值的文本表示形式和任何挂起的制表符间距一起写入到输出流。Writes the text representation of a Boolean value to the output stream, along with any pending tab spacing.

(继承自 HtmlTextWriter)
Write(Char)

将 Unicode 字符的文本表示形式和任何挂起的制表符间距一起写入到输出流。Writes the text representation of a Unicode character to the output stream, along with any pending tab spacing.

(继承自 HtmlTextWriter)
Write(Char[])

将 Unicode 字符数组的文本表示形式和任何挂起的制表符间距一起写入到输出流。Writes the text representation of an array of Unicode characters to the output stream, along with any pending tab spacing.

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
Write(Decimal)

将小数值的文本表示形式写入文本流。Writes the text representation of a decimal value to the text stream.

(继承自 TextWriter)
Write(Double)

将双精度浮点数的文本表示形式和任何挂起的制表符间距一起写入到输出流。Writes the text representation of a double-precision floating-point number to the output stream, along with any pending tab spacing.

(继承自 HtmlTextWriter)
Write(Int32)

将 32 字节的带符号整数的文本表示形式和任何挂起的制表符间距一起写入到输出流。Writes the text representation of a 32-byte signed integer to the output stream, along with any pending tab spacing.

(继承自 HtmlTextWriter)
Write(Int64)

将 64 字节的带符号整数的文本表示形式和任何挂起的制表符间距一起写入到输出流。Writes the text representation of a 64-byte signed integer to the output stream, along with any pending tab spacing.

(继承自 HtmlTextWriter)
Write(Object)

将对象的文本表示形式和任何挂起的制表符间距一起写入到输出流。Writes the text representation of an object to the output stream, along with any pending tab spacing.

(继承自 HtmlTextWriter)
Write(ReadOnlySpan<Char>)

将字符范围写入文本流。Writes a character span to the text stream.

(继承自 TextWriter)
Write(Single)

将单精度浮点数的文本表示形式和任何挂起的制表符间距一起写入到输出流。Writes the text representation of a single-precision floating-point number to the output stream, along with any pending tab spacing.

(继承自 HtmlTextWriter)
Write(String)

将指定的字符串和任何挂起的制表符间距一起写入到输出流。Writes the specified string to the output stream, along with any pending tab spacing.

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
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.

(继承自 TextWriter)
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.

(继承自 HtmlTextWriter)
Write(StringBuilder)

将字符串生成器写入文本流。Writes a string builder to the text stream.

(继承自 TextWriter)
Write(UInt32)

将 4 字节无符号整数的文本表示形式写入文本流。Writes the text representation of a 4-byte unsigned integer to the text stream.

(继承自 TextWriter)
Write(UInt64)

将 8 字节无符号整数的文本表示形式写入文本流。Writes the text representation of an 8-byte unsigned integer to the text stream.

(继承自 TextWriter)
WriteAsync(Char)

将字符异步写入文本流。Writes a character to the text stream asynchronously.

(继承自 TextWriter)
WriteAsync(Char[])

将字符数组异步写入文本流。Writes a character array to the text stream asynchronously.

(继承自 TextWriter)
WriteAsync(Char[], Int32, Int32)

以异步形式将字符的子数组写入文本流。Writes a subarray of characters to the text stream asynchronously.

(继承自 TextWriter)
WriteAsync(ReadOnlyMemory<Char>, CancellationToken)

以异步形式将字符内存区域写入文本流。Asynchronously writes a character memory region to the text stream.

(继承自 TextWriter)
WriteAsync(String)

将字符串异步写入文本流。Writes a string to the text stream asynchronously.

(继承自 TextWriter)
WriteAsync(StringBuilder, CancellationToken)

以异步形式将字符串生成器写入文本流。Asynchronously writes a string builder to the text stream.

(继承自 TextWriter)
WriteAttribute(String, String)

将指定的标记属性和值写入到输出流。Writes the specified markup attribute and value to the output stream.

(继承自 HtmlTextWriter)
WriteAttribute(String, String, Boolean)

将指定标记特性和值写入输出流,并且(如果指定)写入经过编码的值。Writes the specified markup attribute and value to the output stream, and, if specified, writes the value encoded.

(继承自 HtmlTextWriter)
WriteBeginTag(String)

将任何制表符间距和指定标记元素的开始标记写入到输出流。Writes any tab spacing and the opening tag of the specified markup element to the output stream.

(继承自 HtmlTextWriter)
WriteBreak()

<br/> 元素写入 XHTML 输出流。Writes a <br/> element to the XHTML output stream.

WriteEncodedText(String)

对请求设备的指定文本进行编码,然后将其写入到输出流。Encodes the specified text for the requesting device, and then writes it to the output stream.

(继承自 HtmlTextWriter)
WriteEncodedUrl(String)

对指定的 URL 进行编码,然后将它写入到输出流。Encodes the specified URL, and then writes it to the output stream. URL 可以包括参数。The URL might include parameters.

(继承自 HtmlTextWriter)
WriteEncodedUrlParameter(String)

对请求的设备的指定 URL 参数进行编码,然后将它写入到输出流。Encodes the specified URL parameter for the requesting device, and then writes it to the output stream.

(继承自 HtmlTextWriter)
WriteEndTag(String)

写入指定标记元素的任何制表符间距和结束标记。Writes any tab spacing and the closing tag of the specified markup element.

(继承自 HtmlTextWriter)
WriteFullBeginTag(String)

将任何制表符间距和指定标记元素的开始标记写入到输出流。Writes any tab spacing and the opening tag of the specified markup element to the output stream.

(继承自 HtmlTextWriter)
WriteLine()

将行结束符字符串写入到输出流。Writes a line terminator string to the output stream.

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
WriteLine(Char)

将任何挂起的制表符间距和一个 Unicode 字符写入到输出流,并在后面跟上一个行结束符字符串。Writes any pending tab spacing and a Unicode character, followed by a line terminator string, to the output stream.

(继承自 HtmlTextWriter)
WriteLine(Char[])

将任何挂起的制表符间距和一个 Unicode 字符数组写入到输出流,并在后面跟上一个行结束符字符串。Writes any pending tab spacing and an array of Unicode characters, followed by a line terminator string, to the output stream.

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
WriteLine(Decimal)

将小数值的文本表示形式写入文本流,后跟行终止符。Writes the text representation of a decimal value to the text stream, followed by a line terminator.

(继承自 TextWriter)
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.

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
WriteLine(Object)

将任何挂起的制表符间距和一个对象的文本表示形式写入到输出流,并在后面跟上一个行结束符字符串。Writes any pending tab spacing and the text representation of an object, followed by a line terminator string, to the output stream.

(继承自 HtmlTextWriter)
WriteLine(ReadOnlySpan<Char>)

将字符范围的文本表示形式写入文本流,后跟行终止符。Writes the text representation of a character span to the text stream, followed by a line terminator.

(继承自 TextWriter)
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.

(继承自 HtmlTextWriter)
WriteLine(String)

将任何挂起的制表符间距和一个文本字符串写入到输出流,并在后面跟上一个行结束符字符串。Writes any pending tab spacing and a text string, followed by a line terminator string, to the output stream.

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
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.

(继承自 HtmlTextWriter)
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).

(继承自 TextWriter)
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.

(继承自 HtmlTextWriter)
WriteLine(StringBuilder)

将字符串生成器的文本表示形式写入文本流,后跟行终止符。Writes the text representation of a string builder to the text stream, followed by a line terminator.

(继承自 TextWriter)
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.

(继承自 HtmlTextWriter)
WriteLine(UInt64)

将 8 字节无符号整数的文本表示形式写入文本流,后跟行终止符。Writes the text representation of an 8-byte unsigned integer to the text stream, followed by a line terminator.

(继承自 TextWriter)
WriteLineAsync()

以异步形式将行终止符写入文本流。Asynchronously writes a line terminator to the text stream.

(继承自 TextWriter)
WriteLineAsync(Char)

以异步形式将字符写入文本流,后跟行终止符。Asynchronously writes a character to the text stream, followed by a line terminator.

(继承自 TextWriter)
WriteLineAsync(Char[])

以异步形式将字符数组写入文本流,后跟行终止符。Asynchronously writes an array of characters to the text stream, followed by a line terminator.

(继承自 TextWriter)
WriteLineAsync(Char[], Int32, Int32)

以异步形式将字符子数组写入文本流,后跟行终止符。Asynchronously writes a subarray of characters to the text stream, followed by a line terminator.

(继承自 TextWriter)
WriteLineAsync(ReadOnlyMemory<Char>, CancellationToken)

以异步形式将字符内存区域的文本表示形式写入文本流,后跟行终止符。Asynchronously writes the text representation of a character memory region to the text stream, followed by a line terminator.

(继承自 TextWriter)
WriteLineAsync(String)

以异步形式将字符串写入文本流,后跟行终止符。Asynchronously writes a string to the text stream, followed by a line terminator.

(继承自 TextWriter)
WriteLineAsync(StringBuilder, CancellationToken)

以异步形式将字符串生成器的文本表示形式写入文本流,后跟行终止符。Asynchronously writes the text representation of a string builder to the text stream, followed by a line terminator.

(继承自 TextWriter)
WriteLineNoTabs(String)

将一个字符串写入到输出流,并在后面跟上一个行结束符字符串。Writes a string, followed by a line terminator string, to the output stream. 此方法忽略任何指定的制表符间距。This method ignores any specified tab spacing.

(继承自 HtmlTextWriter)
WriteStyleAttribute(String, String)

将指定的样式属性写入到输出流。Writes the specified style attribute to the output stream.

(继承自 HtmlTextWriter)
WriteStyleAttribute(String, String, Boolean)

将指定的样式特性和值写入到输出流,如果指定了值,则还要对值进行编码。Writes the specified style attribute and value to the output stream, and encodes the value, if specified.

(继承自 HtmlTextWriter)
WriteUrlEncodedString(String, Boolean)

写入指定的字符串,并根据 URL 要求对它进行编码。Writes the specified string, encoding it according to URL requirements.

(继承自 HtmlTextWriter)

显式接口实现

IDisposable.Dispose()

有关此成员的说明,请参见 Dispose()For a description of this member, see Dispose().

(继承自 TextWriter)

适用于

另请参阅