次の方法で共有


HtmlTextWriter.SemicolonChar フィールド

セミコロン (;) 文字を表します。

Public Const SemicolonChar As Char
[C#]
public const char SemicolonChar;
[C++]
public: const __wchar_t SemicolonChar;
[JScript]
public var SemicolonChar : Char;

使用例

[Visual Basic, C#, C++] さまざまなスタイル属性を HTML の Label 要素に表示するために SemiColonChar フィールドを使用するコード例を次に示します。

 
Protected Overrides Sub Render(writer As HtmlTextWriter)
   writer.WriteBeginTag("label")
   writer.Write(HtmlTextWriter.SpaceChar)
   ' Output the string "style" followed by "=\"".
   writer.Write("style" + HtmlTextWriter.EqualsDoubleQuoteString)
   ' Output the style attribute "font-size".
   writer.Write("font-size" + HtmlTextWriter.StyleEqualsChar + "12pt")
   ' Output a style attribute separator.
   writer.Write(HtmlTextWriter.SemicolonChar)
   ' Output the style attribute "color".
   writer.Write("color" + HtmlTextWriter.StyleEqualsChar + "fuchsia")
   ' Output the double quote character.
   writer.Write(HtmlTextWriter.DoubleQuoteChar)
   ' Output the '>' character.
   writer.Write(HtmlTextWriter.TagRightChar)
   ' Output the 'Message' property.
   writer.Write(Message)
   ' Output the 'Message' property contents and the time on the server.
   writer.Write("<br>" + "<font color=""blue"">" + _
               "The time on the server: " + _
               System.DateTime.Now.ToLongTimeString() + "</font>")
End Sub

[C#] 
protected override void Render(HtmlTextWriter writer)
{
   writer.WriteBeginTag("label");
   writer.Write(HtmlTextWriter.SpaceChar);
   // Output the string "style" followed by "=\"".
   writer.Write("style" + HtmlTextWriter.EqualsDoubleQuoteString);
   // Output the style attribute "font-size".
   writer.Write("font-size" + HtmlTextWriter.StyleEqualsChar + "12pt");
   // Output a style attribute separator.
   writer.Write(HtmlTextWriter.SemicolonChar);
   // Output the style attribute "color".
   writer.Write("color" + HtmlTextWriter.StyleEqualsChar + "fuchsia");
   // Output the double quote character.
   writer.Write(HtmlTextWriter.DoubleQuoteChar);
   // Output the '>' character.
   writer.Write(HtmlTextWriter.TagRightChar);
   // Output the 'Message' property.
   writer.Write(Message);
   // Output the 'Message' property contents and the time on the server.
   writer.Write("<br>" + "<font color=\"blue\">" +
               "The time on the server: " +
               System.DateTime.Now.ToLongTimeString() +
               "</font>");
}

[C++] 
protected:
   void Render(HtmlTextWriter* writer)
   {
      writer->WriteBeginTag(S"label");
      writer->Write(HtmlTextWriter::SpaceChar);
      // Output the string "style" followed by "=\"".
      writer->Write(S"style{0}", HtmlTextWriter::EqualsDoubleQuoteString);
      // Output the style attribute "font-size".
      writer->Write(S"font-size{0}12pt",__box(HtmlTextWriter::StyleEqualsChar));
      // Output a style attribute separator.
      writer->Write(HtmlTextWriter::SemicolonChar);
      // Output the style attribute "color".
      writer->Write(S"color{0}fuchsia",__box(HtmlTextWriter::StyleEqualsChar));
      // Output the double quote character.
      writer->Write(HtmlTextWriter::DoubleQuoteChar);
      // Output the '>' character.
      writer->Write(HtmlTextWriter::TagRightChar);
      // Output the 'Message' property.
      writer->Write(Message);
      // Output the 'Message' property contents and the time on the server.
      writer->Write(S"<br><font color=\"blue\">The time on the server: {0}</font>",
         System::DateTime::Now.ToLongTimeString() );
   }

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 2000, Windows XP Professional, Windows Server 2003 ファミリ

参照

HtmlTextWriter クラス | HtmlTextWriter メンバ | System.Web.UI 名前空間