How do I programmatically save an image from a URL?

后端 未结 4 597
星月不相逢
星月不相逢 2020-11-30 22:05

How do I programmatically save an image from a URL? I am using C# and need to be able grab images from a URL and store them locally. ...and no, I am not stealing :)

4条回答
  •  情深已故
    2020-11-30 22:54

    It would be easier to write something like this:

    WebClient webClient = new WebClient();
    webClient.DownloadFile(remoteFileUrl, localFileName);

提交回复
热议问题