- 第一种方法
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
namespace downloader_WebClient.DownloadFile
{
class Program
{
static void Main(string[] args)
{
string URL = "http://ansbase5.info/vfm/vfm-admin/images/blog.jpg";
string savename = @"x:\blog.jpg";
WebClient mywebclient = new WebClient();
mywebclient.DownloadFile(URL,savename);
Console.WriteLine(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName);//打印当前文件名
Console.ReadKey();
}
}
}
- 第二种 异步下载
aaaaa