Friday, January 9, 2015

VB.NET - Write Text File Using StreamWriter

Imports System.IO

 Dim strDirectory As String = "C:\temp324\"

        If Directory.Exists(strDirectory) = False Then
            Directory.CreateDirectory(strDirectory)
        End If


        Using objWriter As StreamWriter = New StreamWriter(strDirectory & "\links.txt", False)
            objWriter.Write(txtText.Text)
        End Using

No comments:

Post a Comment