BinaryWriter problem

  • Thread starter Thread starter Peyman
  • Start date Start date
P

Peyman

Hello all,
This is my first c# program. And I seem to have a problem. Here is the
code:

FileStream myStream = new FileStream("d:\\test.txt",
FileMode.Create, FileAccess.Write);

BinaryWriter writer = new BinaryWriter(myStream);

writer.Write("ntestestse");
writer.Close();

In my text file I get a line feed 0x0a as the first char and then the
string "ntestestse" (including the n). I have realised that if i
change the string to test then I get a 0x09 (tab) as the first char in
the file. so it seems to be related to the first char of my string.
Any ideas???

thanks
Peyman Zehtab-Fard
 
Thanks,
I should have seen that. I am using StreamWriter now and all is working
fine.

Regards
Peyman Zehtab-Fard
 
Back
Top