public ActionResult Image() { var random = new JRandom(); Session[c_code] = random.Next(); MemoryStream stream = new MemoryStream(); PsHelper.Text2Image(stream, random.Content); return(File(stream.ToArray(), "image/jpeg")); }