asp.net取得上传图片的高度和宽度
练习:
if (FileUpload1.HasFile)
{
string path = this.FileUpload1.PostedFile.FileName;
System.Net.FileWebRequest q = (System.Net.FileWebRequest)System.Net.FileWebRequest.Create(path);
System.Net.FileWebResponse p = (System.Net.FileWebResponse)q.GetResponse();
System.Drawing.Image bmp = System.Drawing.Image.FromStream(p.GetResponseStream());
Response.Write(bmp.Width + ":" + bmp.Height);
}