(1)添加引用 System.Web。
(2)在类中填写 using System.Web 命名空间。
(3)写法为: System.Web.HttpContext.Current.Server.MapPath("~/Upload/LosskWh/" + imgItem);