上传照片时如何读出照片的长度和宽度

上传照片时怎么读出照片的长度和宽度
谢谢

------解决方案--------------------
System.Drawing.Image upImage = System.Drawing.Image.FromStream(File1.PostedFile.InputStream);
int width=upImage.Width;
int height=upImage.Height;