C#Windows应用程序中的文件下载功能

时间:2013-03-05 15:56:58

标签: c#

我正在使用C# Windows 应用程序。我需要实现一个功能,将CSV模板下载到用户,他/她可以填写并上传。

该文件只需要在解决方案中。

有人能建议我解决吗?

谢谢!

1 个答案:

答案 0 :(得分:2)

如果要从特定WebSite下载文件,请使用Webclient类(添加对System.Web的引用)

WebClient webClient = new WebClient();
webClient.DownloadFile("http://mysite.com/myfile.csv", @"c:\Temp\myfile.csv");
相关问题