首先是创建一个类,继承于ActionResult,记住要引用System.Web.Mvc命名空间,如下: 代码如下: public class ImageResult : ActionResult { public ImageFormat ContentType { get; set; } public Image image { get; set; } public string SourceName { get; set; } public ImageResult(string _SourceName, ImageFormat _ContentType) { this.SourceNam