计算上传的图片的宽和高    
string url="你上传图片所在的地址";
System.Net.FileWebRequest q =
(System.Net.FileWebRequest)System.Net.FileWebRequest.Create(url);
System.Net.FileWebResponse p = (System.Net.FileWebResponse)q.GetResponse();
System.Drawing.Image bmp = System.Drawing.Image.FromStream(p.GetResponseStream());
System.Drawing.Image bmp=System.Drawing.Image.FromStream(p.GetResponseStream());
Console.WriteLine("宽:{0}",bmp.Width );
Console.WriteLine("高:{0}",bmp.Height );

关联文档