Work with File

Path Examples
Reading and Writing
Writting text file
w r
Index String html
Writeline
Writing Text to a File
File
[C#]using System;
using System.IO;

class Test
{
public static void Main()
{
// Create an instance of StreamWriter to write text to a file.
// The using statement also closes the StreamWriter.
using (StreamWriter sw = new StreamWriter("TestFile.txt"))
{
// Add some text to the file.
sw.Write("This is the ");
sw.WriteLine("header for the file.");
sw.WriteLine("-------------------");
// Arbitrary objects can also be written to the file.
sw.Write("The date is: ");
sw.WriteLine(DateTime.Now);
}
}
Tạo một tập tin cố định chiều rộng trong C #
Insert Text into Existing Files in C#, Without Temp Files or Memory Buffers
Text Reader and Text Writer in C#

Resource