试试下面的代码
using (var img = new Bitmap(Image.FromFile(cuo.ErrorPath))) { cuo.Hei = img.Height.ToString(); } Thread.Sleep(100);