Code
vb
' Write all text
System.IO.File.WriteAllText("output.txt", "Hello")
' Read all text
Dim content As String = System.IO.File.ReadAllText("input.txt")
' Append
System.IO.File.AppendAllText("log.txt", $"[{Date.Now}] Event{Environment.NewLine}")
' Read lines
For Each line As String In System.IO.File.ReadLines("data.txt")
Console.WriteLine(line)
Next
' My.Computer.FileSystem (VB shortcut)
If My.Computer.FileSystem.FileExists("data.txt") Then
Dim text As String = My.Computer.FileSystem.ReadAllText("data.txt")
My.Computer.FileSystem.WriteAllText("copy.txt", text, False)
End If
' Binary
Dim bytes() As Byte = System.IO.File.ReadAllBytes("image.png")
System.IO.File.WriteAllBytes("copy.png", bytes)