Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Dim lines() As String = {"This is some random text", "saved to a file"}
- 'Dim mydocpath As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
- 'Using outputFile As New StreamWriter(mydocpath & Convert.ToString("\randomtext.txt"))
- ' For Each line As String In lines
- ' outputFile.WriteLine(line)
- ' Next
- 'End Using
- 'Using outputFile As New StreamWriter(mydocpath & Convert.ToString("\randomtext.txt"), True)
- ' outputFile.WriteLine("Here is more info")
- 'End Using
- 'Try
- ' Using sr As New StreamReader(mydocpath & Convert.ToString("\randomtext.txt"))
- ' Dim line As String
- ' line = sr.ReadToEnd()
- ' txtOutput &= line & Environment.NewLine
- ' End Using
- 'Catch ex As Exception
- ' MessageBox.Show("Couldn't read file", "Error")
- 'End Try
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement