XmlTextWriter.Flush メソッド
アセンブリ: System.Xml (system.xml.dll 内)


![]() |
---|
Microsoft .NET Framework version 2.0 リリースでは、System.Xml.XmlWriter.Create メソッドと XmlWriterSettings クラスを使用して XmlWriter インスタンスを作成することをお勧めします。これにより、このリリースで導入されたすべての新機能を十分に活用できます。詳細については、「XML ライタの作成」を参照してください。 |
バッファ内のデータを消さずに、基になるストリームに追加の書き込みを行う場合は、Close の代わりにこれが呼び出されます。

Imports System Imports System.IO Imports System.Xml public class Sample public shared sub Main() Dim writer as XmlTextWriter = new XmlTextWriter (Console.Out) 'Use indenting for readability writer.Formatting = Formatting.Indented 'Write an XML fragment. writer.WriteStartElement("book") writer.WriteElementString("title", "Pride And Prejudice") writer.WriteEndElement() writer.Flush() 'Write another XML fragment. writer.WriteStartElement("cd") writer.WriteElementString("title", "Americana") writer.WriteEndElement() writer.Flush() 'Close the writer. writer.Close() end sub end class
using System; using System.IO; using System.Xml; public class Sample { public static void Main() { XmlTextWriter writer = new XmlTextWriter (Console.Out); //Use indenting for readability writer.Formatting = Formatting.Indented; //Write an XML fragment. writer.WriteStartElement("book"); writer.WriteElementString("title", "Pride And Prejudice"); writer.WriteEndElement(); writer.Flush(); //Write another XML fragment. writer.WriteStartElement("cd"); writer.WriteElementString("title", "Americana"); writer.WriteEndElement(); writer.Flush(); //Close the writer. writer.Close(); } }
#using <System.Xml.dll> using namespace System; using namespace System::IO; using namespace System::Xml; int main() { XmlTextWriter^ writer = gcnew XmlTextWriter( Console::Out ); // Use indenting for readability writer->Formatting = Formatting::Indented; // Write an XML fragment. writer->WriteStartElement( "book" ); writer->WriteElementString( "title", "Pride And Prejudice" ); writer->WriteEndElement(); writer->Flush(); // Write another XML fragment. writer->WriteStartElement( "cd" ); writer->WriteElementString( "title", "Americana" ); writer->WriteEndElement(); writer->Flush(); // Close the writer. writer->Close(); }
import System.*; import System.IO.*; import System.Xml.*; public class Sample { public static void main(String[] args) { XmlTextWriter writer = new XmlTextWriter(Console.get_Out()); //Use indenting for readability writer.set_Formatting(Formatting.Indented); //Write an XML fragment. writer.WriteStartElement("book"); writer.WriteElementString("title", "Pride And Prejudice"); writer.WriteEndElement(); writer.Flush(); //Write another XML fragment. writer.WriteStartElement("cd"); writer.WriteElementString("title", "Americana"); writer.WriteEndElement(); writer.Flush(); //Close the writer. writer.Close(); } //main } //Sample

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からXmlTextWriter.Flush メソッドを検索する場合は、下記のリンクをクリックしてください。

- XmlTextWriter.Flush メソッドのページへのリンク