答案 0 :(得分:1)
您需要提供文件所在的URL。
例如,查看此控制台应用程序。它会从 网址 下载头像,并将其作为gravatar.jpg
保存到桌面。
class Program
{
static void Main(string[] args)
{
WebClient client = new WebClient();
string address = "https://www.gravatar.com/avatar/957c8334a5950ba301f66662b36da7d1";
// Save the file to desktop for debugging
var desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
string fileName = desktop + "\\gravatar.jpg";
client.DownloadFile(address, fileName);
Console.ReadLine();
}
}