How to write to text file with using statement in VB.NET

1 Answer

0 votes
Imports System.IO

Module Module1

    Sub Main()

        Using tw As TextWriter = File.CreateText("d:\\data.txt")
            tw.WriteLine("line one")
            tw.WriteLine("line two")
        End Using

    End Sub

End Module

' run:
' 

 



answered May 13, 2016 by avibootz

Related questions

1 answer 222 views
1 answer 280 views
1 answer 187 views
2 answers 263 views
1 answer 277 views
1 answer 197 views
1 answer 267 views
...