Get a picture on the request.
-
Hello. There's such a simple task: sending a request to the server and downloading, for example, some picture in a file, finding the stories.
img
That's it.html
code. I kind of understand how C# can be sent.get
- Ask, gethtml
I'll take a look at him.img
and get the parameter out of there.src
But here's what to do with the picture address, I don't understand. Anyway, in my case, there's something not just an address, but something else.get
- a request that indicates the parameters of a picture of the type of width and height. Never faced such challenges. If anyone tells me what you can read about it, I'll be grateful.
-
You can use WebClient.DownloadFile to download the URL image.
WebClient wc = new WebClient();
wc.DownloadFile("http://example.com/z.png",@"c:\z.png");
To get a direct link to downloading, you can use some HTML-Parser, like, http://htmlagilitypack.codeplex.com/ and evaporate HTML.