开发者

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

开发者 https://www.devze.com 2022-12-15 08:14 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消