[SOLVED] using downloadFile downloads the file, but does not preserve line breaks

Issue

I am trying to download a data file to my application the file can be viewed here:

http://www.net-flyer.net/DataFeed/vatsim-data.txt

here is my code:

string address = "http://www.net-flyer.net/DataFeed/vatsim-data.txt";
string filename = "vsd.txt";
WebClient client = new WebClient();
client.DownloadFile(address,filename);

It downloads the file like I want, but there are no line breaks in the downloadedfile, it is just one continous line of text. Does anyone know what I’m doing wrong?

Solution

Actually your downloaded file uses 0x0A characters as line breaks. It looks nice on your web browser but seems to be missed when you open your downloaded file on notepad. Try open it on another editor, like Visual Studio.

If you open that downloaded file within an hex editor, you’ll see they’re equal.

Answered By – Rubens Farias

Answer Checked By – Marie Seifert (BugsFixing Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *