从链接获取大小图像

时间:2017-01-03 03:42:50

标签: c#

我想在C#中检查来自url的大小图片。 例如:网址:http://img.khoahoc.tv/photos/image/2015/05/14/hang_13.jpg

请帮帮我。非常感谢你

2 个答案:

答案 0 :(得分:5)

下载并查看:

string image = @"http://img.khoahoc.tv/photos/image/2015/05/14/hang_13.jpg";
byte[] imageData = new WebClient().DownloadData(image);
MemoryStream imgStream = new MemoryStream(imageData);
Image img = Image.FromStream(imgStream);

int wSize = img.Width;
int hSize = img.Height;

答案 1 :(得分:0)

   productId       date price competitor competitor_price leader
1     banana 2014-05-05  2.12     google             1.99      0
2     banana 2014-06-22  2.31    tencent             2.52      1
3     banana 2014-07-05  2.29       <NA>               NA     NA
4     banana 2014-08-31  2.01       <NA>               NA     NA
5     banana 2014-05-03  2.04       <NA>               NA     NA
6     banana 2014-02-22  2.09       <NA>               NA     NA
7        fig 2014-05-21  5.22       <NA>               NA     NA
8        fig 2014-06-19  5.36       <NA>               NA     NA
9        fig 2014-03-09  5.21       <NA>               NA     NA
10       fig 2014-06-22  5.91       <NA>               NA     NA
11       fig 2014-07-03  5.36       <NA>               NA     NA
12       fig 2014-09-08  5.56       <NA>               NA     NA
>