HtmlTextWriter.SlashChar 欄位

定義

表示斜線符號 (/)。

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 撰寫標記專案的結束記號時使用 欄位。

適用於

另請參閱