Question : How to download an image from a website and save it in my project folder By Using .NET C#

1) How to download an image from a website and save it in my project folder; I tried the following which does not work.
  WebClient Client = new WebClient();
        byte[] image;
        Client.UploadData("http://www.freeiconsweb.com/Freeicons/3D_food_icons/orange.png", image);

I get compile error like: Use of unassigned local variable 'image'
And I am trying to make the tutorial work at:  http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=115

2) How to download a gif image and then convert to jpg and save it in my client/image or in my project folder

Please give code examples.

Answer : How to download an image from a website and save it in my project folder By Using .NET C#

You should be able to use the following to get the directory to save in

Path.Combine(HttpRuntime.AppDomainAppPath, @"Images\logo.jpg")
Random Solutions  
 
programming4us programming4us