I'm using Visual Studios 2008 to write a small program that writes to a file.
The program works fine until I run it on my server at work, where for some reason it adds a "next line" (like vbCrLf command) at the end of the second line in the .txt file.
Looks like three squeres:
"Location =□□□"
A copy paste of the string from textfile is shown under:
"Location =
"
Excerpt from program:
If saveFileDialog1.ShowDialog() = DialogResult.OK Then
myStream = saveFileDialog1.OpenFile()
If (myStream IsNot Nothing) Then
Using sw As System.IO.StreamWriter = New System.IO.StreamWriter(myStream)
For Lagre = 0 To UBound(RunNr) - 1
sw.Write(RunNr(Lagre) & vbCrLf)
Next
End Using
myStream.Close()
Me.Close()
End If
End If
The content of the resulting .txt file:
Date & time = 22 mar 2011
Location =□□□
File Name = 1.txt
One
Two
Three
Four