您的位置:首页 > 编程语言 > C#

C#怎样从指定服务器上下载指定文件到本地电脑上

2015-08-11 10:20 447 查看
using System;
using System.Net;

namespace ConsoleApplication2
{
class Program
{

public static void Get_img()
{
try
{
WebClient wClient = new WebClient();
wClient.DownloadFile("http://xxxxxxx/wKiFR1XIHriAQ3M1AAr915dq3c4344.jpg", "E:\\1.jpg");
}
catch (Exception ex) { string aa = ex.Message; }
}

static void Main(string[] args)
{
Get_img();
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: