public void ProcessRequest(HttpContext context)
    {
        //参数
        string imgcid=context.Request["imgcid"];
        string imgWidth = context.Request["imgWidth"];
        string strFilePath=TaiHeWenHuaHelper.GetCJImgPath(imgcid, Convert.ToInt32(imgWidth)); //获得图片的路径

        FileStream fs = new FileStream(context.Server.MapPath(strFilePath) , FileMode.Open);//获得图片的物理路径后把图片读取到文件流中
        byte[] bytes = new byte[(int)fs.Length];
        fs.Read(bytes, 0, bytes.Length);
        fs.Close();

        context.Response.ClearContent();
        context.Response.ContentType = "image/jpg"; //图片的格式
        context.Response.BinaryWrite(bytes);  //输出图片
    }

 

相关文章:

  • 2021-11-23
  • 2022-12-23
  • 2022-02-10
  • 2021-05-22
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2021-12-13
猜你喜欢
  • 2021-07-11
  • 2021-10-05
  • 2022-12-23
  • 2021-11-01
  • 2021-08-14
  • 2021-09-25
相关资源
相似解决方案