【问题标题】:c# access an image in app_themes folderc# 访问 app_themes 文件夹中的图像
【发布时间】:2016-01-29 16:16:45
【问题描述】:

我的 App_Themes/Default 文件夹中有一张图片,我想将其加载到字节数组中。但是我在获取文件时遇到问题。有没有简单的 c# 方法可以做到这一点?

我的解决方案如下所示:

-项目
-App_Themes
-默认
-image1.png

【问题讨论】:

    标签: c# asp.net image app-themes


    【解决方案1】:

    您可以使用 Server.MapPath() 获取相对 url 的完整本地文件路径,例如:

    string lFileName = Server.MapPath("~/App_Themes/Default/xyz.png");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-28
      • 1970-01-01
      • 1970-01-01
      • 2011-01-25
      • 1970-01-01
      • 1970-01-01
      • 2018-12-30
      • 2017-03-23
      相关资源
      最近更新 更多