c# - 下载直接文件

标签 c# download

我想直接从网址下载文件(例如:http://iranfairco.com/icon/Iranfairco.png) 并将此文件保存在我们的服务器上。

我该怎么做?

最佳答案

您可以使用WebClient.DownloadFile(url,local) 例如

WebClient webClient = new WebClient();
webClient.DownloadFile("http://iranfairco.com/icon/Iranfairco.png",@"c:\mypng.png");

关于c# - 下载直接文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7744480/

相关文章:

c# - 左外连接代码的列名称不明确

ListView 中的 C# 图像

iPhone SDK : How do you download video files to the Document Directory and then play them?

c# - 如何单独更新进度条(同时下载)

c# - 获取 Azure Active Directory token

c# - 遍历列表并修改对象正在更新原始对象

c# - WPF:拉伸(stretch) TreeView

go - 如何使用 Go 有效地下载大文件?

ios - TestFlight 错误 "Your request couldn' t 完成”?

html - Apple iOS 企业开发者计划设备检查