It would be easier to write something like this:
WebClient webClient = new WebClient();
webClient.DownloadFile(remoteFileUrl, localFileName);
Related Contents:
- Setting WPF image source in code
- Getting image dimensions without reading the entire file
- Merging two images in C#/.NET
- Validate image from file in C#
- Converting Bitmap PixelFormats in C#
- Download image from the site in .NET/C#
- Transparent images with C# WinForms
- High quality JPEG compression with c#
- How to find reason for Generic GDI+ error when saving an image?
- Image.Save() throws exception “Value cannot be null./r/nParameter name: encoder”
- Image.FromStream() method returns Invalid Argument exception
- Extract Embedded Image Object in RTF
- Find image format using Bitmap object in C#
- Error” Parameter is not valid ” while converting Bytes into Image
- DateTime vs DateTimeOffset
- Interaction between forms — How to change a control of a form from another form?
- ArrayList vs List in C#
- How do I get output from a command to appear in a control on a Form in real-time?
- Deciding between HttpClient and WebClient
- How do I decompile a .NET EXE into readable C# source code?
- How to detect the currently pressed key?
- Wait until a process ends
- How can I read a file even when getting an “in use by another process” exception?
- delegate keyword vs. lambda notation
- Entity Framework 4 – AddObject vs Attach
- Is there an easy way to return a string repeated X number of times?
- .NET Out Of Memory Exception – Used 1.3GB but have 16GB installed
- C# class to parse WebRequestMethods.Ftp.ListDirectoryDetails FTP response
- ReadOnlyCollection or IEnumerable for exposing member collections?
- How to handle click event in Button Column in Datagridview?
- how to implement url rewriting similar to SO
- WPF Image to byte[]
- GetHashCode Guidelines in C#
- How to properly make a http web GET request
- What is the point of Lookup?
- Exception when AddWithValue parameter is NULL
- Query an XDocument for elements by name at any depth
- What’s the best way to calculate the size of a directory in .NET?
- How to refresh DataSource of a ListBox
- Internal vs. Private Access Modifiers
- When should I use the HashSet type?
- Apply function to all elements of collection through LINQ [duplicate]
- Is there any way to call the parent version of an overridden method? (C# .NET)
- How to hide public methods from IntelliSense
- OWIN’s GetExternalLoginInfoAsync Always Returns null
- SQLite .NET performance, how to speed up things?
- How to convert a simple .Net console project a into portable exe with Mono and mkbundle?
- Ignoring a field during .NET JSON serialization; similar to [XmlIgnore]?
- Garbage Collection not happening even when needed
- Days, hours, minutes, seconds between two dates