Tag Archives: StreamReader

Read and write text in text files in C#

When you click the example program’s Write button, the following code writes the values in the text boxes into a file. // Write the text values into the file. private void btnWrite_Click(object sender, EventArgs e) { StreamWriter stream_writer = new … Continue reading

Posted in files | Tagged , , , , , , , , , , , , | 2 Comments

Build a formatted XML document in memory in C#

This example uses an XmlTextWriter to build a formatted XML document in memory and displays it in a text box. When you click the Go button, the following code executes. private void btnGo_Click(object sender, EventArgs e) { MemoryStream memory_stream = … Continue reading

Posted in XML | Tagged , , , , , , , , , , , , , , | 1 Comment