Create FileStream from file name string
Imports System
Imports System.IO
Imports System.Text
Public Class Test
Public Shared Sub Main()
Dim FileName As String= "test.txt"
Dim TextToAdd As String = "data"
Dim Fs As FileStream = New FileStream(FileName, FileMode.CreateNew, FileAccess.Write, FileShare.None)
Dim SwFromFileTrueUTF8Buffer = New StreamWriter(FileName, True, System.Text.Encoding.UTF8, 512)
SwFromFileTrueUTF8Buffer.Write(TextToAdd)
SwFromFileTrueUTF8Buffer.Flush()
SwFromFileTrueUTF8Buffer.Close()
End Sub
End Class
Related examples in the same category