如何使用的web.config文件的文件夹上应用的安全性? [英] How to apply security on a folder using web.config file?

查看:107
本文介绍了如何使用的web.config文件的文件夹上应用的安全性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,我要应用安全就像是谁在使用该网站目前的用户,可以访问该文件夹的文件夹,但如果他不是当前登录那么他就不能看到该文件夹​​或文件夹的文件的内容。我知道我们可以在web.config文件中做到这一点,但我不知道怎么办。请帮帮我。先谢谢了。

I have folder on which i want to apply security like the current user who is using the site, can access that folder but if he is not currently logged in then he cannot see the content of that folder or files of that folder. I know we can do it in web.config file but i dont know how. Please help me. Thanks in advance.

推荐答案

如果我明白这个问题...

If I have understood the question...

您可以在web.config文件中使用位置的元素,有很多关于该网站上的信息 - 这给你一个开始:的 HOW TO:控制授权权限在ASP.NET应用程序

You can use location elements in the web.config file, there is a lot of information on the web about that - this gives you a start: HOW TO: Control Authorization Permissions in an ASP.NET Application

您基本上有这样的内容:

You basically have elements like this:

<configuration>
    <location path="subdir1">
        <system.web>
            <authorization>
                <allow users ="*" />
            </authorization>
        </system.web>
    </location>
</configuration>

这是说允许所有用户的subdir1,你有一个否定元太 - 信息此处的元素的授权

That is saying allow all users to the subdir1, you have a deny element too - information here: authorization Element

这篇关于如何使用的web.config文件的文件夹上应用的安全性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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