HtmlTextWriter.SlashChar 字段
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示斜杠标记(/)。
public: char SlashChar;
public const char SlashChar;
val mutable SlashChar : char
Public Const SlashChar As Char
字段值
示例
下面的代码示例演示如何手动呈现 src 元素的属性 <img> 。 该代码示例使用 Write 包含字段的方法 SlashChar 作为其参数,在应用于 src 特性的路径中呈现斜杠标记。
此代码示例呈现以下标记:
src="/images/
// Write the src attribute and the path
// for the image file.
writer.Write("src");
writer.Write(HtmlTextWriter.EqualsChar);
writer.Write(HtmlTextWriter.DoubleQuoteChar);
writer.Write(HtmlTextWriter.SlashChar);
writer.Write("images");
writer.Write(HtmlTextWriter.SlashChar);
' Write the src attribute and the path
' for the image file.
writer.Write("src")
writer.Write(HtmlTextWriter.EqualsChar)
writer.Write(HtmlTextWriter.DoubleQuoteChar)
writer.Write(HtmlTextWriter.SlashChar)
writer.Write("images")
writer.Write(HtmlTextWriter.SlashChar)
注解
编写 URL 时,使用 SlashChar 字段呈现斜杠标记。 该方法 WriteEndTag 在 SlashChar 编写标记元素的结束标记时使用字段。