如何限制用户从ASP .NET中的文件夹访问图像文件 [英] How to restrict the user to access the image file from the folder in ASP .NET

查看:67
本文介绍了如何限制用户从ASP .NET中的文件夹访问图像文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道我的应用程序中的url基本身份验证http:// localhost:1619 / profilepic / user_image.png



我有什么试过:



I want to know about the url base authentication in my application http://localhost:1619/profilepic/user_image.png

What I have tried:

<location path="profilepic">
    <system.web>
      <authorization>
            <allow users="user"/>
            <deny users="*" />
      </authorization>
    </system.web>
  </location>





这适用于foler。我想限制该文件夹的文件



this will work in the case of foler. I want to restrict the files of that folder

推荐答案

将所有图像文件放在文件夹中>> App_Data

并将图像文件作为编码的base64数据源返回到html页面。
Place all the image files in the folder >> App_Data
and return the image file as encoded base64 data source in the html page.


这篇关于如何限制用户从ASP .NET中的文件夹访问图像文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆