目标:以从本地服务器”localhost“上,下载一副名为"1.dwg"的数据,在D:\以同名保存为例
URL:"http://localhost/hasys/bin-debug/cad/1.dwg"
源码:
if (!File.Exists("D:\\1.dwg"))//判断是否已存在文件
{
WebClient wc = new WebClient();
wc.DownloadFile(new Uri("http://localhost/hasys/bin-debug/cad/1.dwg"), "D:\\1.dwg");
}
来源:https://blog.csdn.net/guzicheng1990/article/details/99599075