BinaryWriter problem

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
 
J

Jay B. Harlow [MVP - Outlook]

P

Peyman Zehtab-Fard

Thanks,
I should have seen that. I am using StreamWriter now and all is working
fine.

Regards
Peyman Zehtab-Fard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top