Use the overloads that do NOT include the encoding parameter.
From:
http://msdn2.microsoft.com
"This method uses UTF-8 encoding without a Byte-Order Mark (BOM)..."
So:
File.WriteAllText(path, createText)
and:
File.AppendAllText(path, appendText)
with:
Dim readText As String = File.ReadAllText(path)
Main Topics
Browse All Topics





by: SanclerPosted on 2006-07-27 at 10:18:00ID: 17194674
The bytes are BOM - byte order markers. I think you will find they were put there by opening and closing the file in Notepad. I'm not able to test right now, but try putting it straight from your output into your hexedit program/function, and see if the problem persists. If it does, you will have to fiddle with the encoding of the output, but I would need to look that up and, as I say, I can't do that right now.
Roger