using downloadFile downloads the file, but does not preserve line breaks
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?
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.
Use Notepad++ or something similar. I use UltraEdit
精彩评论