Bob Burke
New member
Code:
Private Sub butSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butSave.Click
Dim save As New SaveFileDialog()
save.Title = "Save Domain List As Text File"
save.Filter = "Text files (*.txt)|*.txt"
save.FilterIndex = 0
save.RestoreDirectory = True
If save.ShowDialog = DialogResult.OK Then
Dim contents As String
Dim FS As FileStream = save.OpenFile
Dim SW As New StreamWriter(FS, System.Text.Encoding.ASCII)
contents = txtResults.Text()
contents.Replace(vbCrLf, System.Environment.NewLine)
SW.Write(contents)
SW.Close()
FS.Close()
End If
End Sub
This the code I am using to write contents (which is the contents of a multiline textbox named txtResults) to a text file. When I view the textfile in Wordpad or Editplus it is fine but in Notepad all off the data is on one line and is seperated by glyphs... i.e. no carriage returns.
I really need to be able to view this in Notepad and Im also wondering why I cant? Can anyone give me any pointers or workarounds?
Thanks a lot.
~Bob