zoukankan      html  css  js  c++  java
  • MVC 读取图片

    /// <summary>
    /// 获取上传的图片
    /// </summary>  
    public FileResult GetImages(string PhotoPath)
    {

        var filename = PhotoPath.ImageUploadPath();//获取图片路径

        if (!string.IsNullOrEmpty(filename))

          {

            FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read);

            int length = (int)fs.Length;

            byte[] image = new byte[length];

            fs.Read(image, 0, length);

            fs.Close();

            return new FileContentResult(image, "image/jpeg");

          }

          else

          {

            return null;

        }

        }

  • 相关阅读:
    Swift
    Swift
    书籍
    Swift
    Swift
    iOS系统架构
    Reveal真机(越狱)查看任意APP
    Swift
    Swift
    Swift
  • 原文地址:https://www.cnblogs.com/jerrywublogs/p/4599350.html
Copyright © 2011-2022 走看看