missing CR LF with stream writer

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.
 
G

Guoqi Zheng

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?
 
J

Juan T. Llibre

Eliyahu,

Would

sw.Write(NewLine);

also work ?



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

Eliyahu Goldin

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top