missing CR LF with stream writer

  • Thread starter Thread starter Guoqi Zheng
  • Start date Start date
G

Guoqi Zheng

Dear sir,

When I tried to use streamwriter to write a text into a txt file. All the cr
lf in my original text are gone.

Any one know why is that and what should I do???

below is my simple script.
Dim sw As StreamWriter = New StreamWriter("TestFile.txt")
' Add some text to the file.
sw.Write(MyTextVariable)

Thanks.
 
Thanks for your answer.

but that is not what I am looking for. I want know why my CR LF is missing.
I don't need to compare CR LF (which is also chr(10), chr(13)) to newline
property, etc.

Any other answer?
 
Eliyahu,

Would

sw.Write(NewLine);

also work ?



Juan T. Llibre
ASP.NET MVP
===========
 
Juan,

You mean sw.Write(sw.NewLine). Sure.
The original post leaves some room for interpretation, so the responses
could miss the point.

Eliyahu
 

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

Back
Top