Download image from a website : WebRequest : Network C# Examples


C# Examples » Network » WebRequest »

 

Download image from a website









    
using  System;
using  System.Net;
using  System.IO;
using  System.Drawing;
using  System.Collections;
using  System.ComponentModel;
using  System.Windows.Forms;

public  class  MainClass  {

      [STAThread]
      public  static  void  Main(string[]  args)
      {
              string  picUri  =  "http://www.java.com/style/logo.PNG";
              
              //  Create  the  requests.
              WebRequest  requestPic  =  WebRequest.Create(picUri);

              WebResponse  responsePic  =  requestPic.GetResponse();
              
              Image  webImage  =  Image.FromStream(responsePic.GetResponseStream());
      }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Network
» WebRequest