开发者

How do I download a CSV file from a web server to a local machine using HTTP? [duplicate]

This question already has answers here: 开发者_C百科How to download a file from a website in C# [closed] (7 answers) Closed 8 years ago.

How do I download a CSV file from a web server to a local machine using HTTP?


Download file using WebClient:

string url = "urlToFile";
using (var client = new WebClient())
using(var file = File.Create("someFile.ext"))
{
  var bytes = client.DownloadData(uri);
  file.Write(bytes, 0, bytes.Length);   
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜