Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --145ae7dc-e075-478c-8063-eeb765e0e15a
- Content-Type: image/jpeg;
- Content-Length: 41946
- MIME-Version: 1.0
- ÿØÿî Adobe d ÿÃ R G B ÿÄ ÿÚ R G B úÿ ×þ¿Úív¡
- WebClient webClient = new WebClient();
- webClient.Headers["Accept"] = textBoxMimeType.Text;
- var uri = new Uri(url);
- using (Stream webStream = webClient.OpenRead(uri))
- {
- using (FileStream fileStream = new FileStream(outputFile, FileMode.Create))
- {
- var buffer = new byte[32768];
- int bytesRead;
- Int64 bytesReadComplete = 0;
- Int64 bytesTotal = Convert.ToInt64(webClient.ResponseHeaders["Content-Length"]);
- while ((bytesRead = webStream.Read(buffer, 0, buffer.Length)) > 0)
- {
- bytesReadComplete += bytesRead;
- fileStream.Write(buffer, 0, bytesRead);
- }
- }
- }
Add Comment
Please, Sign In to add comment