Use Visual Studio to create a Console application. Remember to reference the assembly System. Drawing;
The Code is as follows:
Using System;
Using System. Drawing;
Using System. IO;
Using System. Net;
Namespace Keleyi. Com
{
Class KeleyiImage
{
Static void Main (string [] args)
{
WebRequest request = WebRequest. Create (@ "http://keleyi.com/image/a/tvh00n12.jpg ");
Request. Credentials = CredentialCache. DefaultCredentials;
Stream s = request. GetResponse (). GetResponseStream ();
Byte [] B = new byte [74373];
MemoryStream mes_keleyi_com = new MemoryStream (B );
S. Read (B, 0, 74373 );
S. Close ();
Image image = Image. FromStream (mes_keleyi_com );
Console. WriteLine ("high {0}, Width {1}", image. Height, image. Width );
Console. WriteLine ("For more information, visit keleyi.com and press any key to exit-ke leyi ");
Console. ReadKey ();
}
}
}
Original article: http://keleyi.com/a/bjac/f37p93cv.htm