Create FileStream with FileMode.Append, FileAccess.Write, FileShare.Write
Imports System
Imports System.IO
Imports System.Text
Class FSOpenWrite
Public Shared Sub Main()
Dim fs As New FileStream("c:\Variables.txt", FileMode.Append, FileAccess.Write, FileShare.Write)
fs.Close()
Dim sw As New StreamWriter("c:\Variables.txt", True, Encoding.ASCII)
Dim NextLine As String = "This is the appended text."
sw.Write(NextLine)
sw.Close()
End Sub
End Class
Related examples in the same category