In C#, file I/O can be performed using the classes in the System.IO namespace. There are various classes available for different file operations like reading, writing, copying, deleting, etc. Here are some examples:

1. Reading from a File:
“`csharp
string filePath = “path/to/file.txt”;
string content = File.ReadAllText(filePath);
Console.WriteLine(content);
“`

2. Writing to a File:
“`csharp
string filePath = “path/to/file.txt”;
string content = “Hello, World!”;
File.WriteAllText(filePath, content);
“`

3. Appending to a File:
“`csharp
string filePath = “path/to/file.txt”;
string content = “Hello, World!”;
File.AppendAllText(filePath, content);
“`

4. Checking if a File Exists:
“`csharp
string filePath = “path/to/file.txt”;
bool exists = File.Exists(filePath);
Console.WriteLine(exists);
“`

5. Deleting a File:
“`csharp
string filePath = “path/to/file.txt”;
File.Delete(filePath);
“`

6. Copying a File:
“`csharp
string sourceFilePath = “path/to/source/file.txt”;
string destinationFilePath = “path/to/destination/file.txt”;
File.Copy(sourceFilePath, destinationFilePath);
“`

These are just a few examples of file I/O operations in C#. The System.IO namespace provides many more classes and methods to work with files and directories.