static void Main(string[] args)
{
HttpWebRequest request;
HttpWebResponse response;
try
{
string picurl = "http://www.imageaimer.com/img2.php?path=images/201011/1290406834875135790.gif&w=450&h=558";
//request = (HttpWebRequest)WebRequest.Create("http://www.imageaimer.com/img2.php?path=images/201011/1290406834875135790.gif&w=450&h=558");
request = (HttpWebRequest)WebRequest.Create(picurl);
response =(HttpWebResponse) request.GetResponse();
if (response.StatusCode == HttpStatusCode.OK)
Console.WriteLine("Response Status Code is OK and StatusDescription is: {0}", response.StatusDescription);
// Releases the resources of the response.
Stream responseStream = response.GetResponseStream();
//StreamReader reader = new StreamReader(responseStream, Encoding.GetEncoding("ASCII"));
//Console.WriteLine(reader.ReadToEnd());
System.Drawing.Image image = Image.FromStream(responseStream);
image.Save("c:\\111.jpg");
response.Close();
}
catch (Exception exp)
{
Console.WriteLine(exp.Message);
}
finally
{
Console.ReadKey();
}
}