求一个根据图片url路径获取图片高度的方法!
rt
[最优解释]
private void button1_Click(object sender, EventArgs e)
{
WebClient wc=new WebClient();
wc.DownloadFile("http://www.baidu.com/img/baidu_sylogo1.gif","temp");
Bitmap b = new Bitmap("temp");
MessageBox.Show(b.Height.ToString());
}
c#代码,先把图片下载下来,然后通过Bitmap类获取高度。
[其他解释]
WebClient 这个类我各人觉得没WebRequest 好用
前几天我才写了个小程序遍历别人的网站 抓图片 所以 感觉WebRequest好用些