开发者

What is a simple way to secure a directory in asp.net? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago. 开发者_StackOverflow中文版

Is there an easy way to do this?


In your web.config, you can use the following:

<location path="AdminDirectory">
    <system.web>
        <authorization>
            <allow roles="Administrators"/>
            <deny users="*"/>
        </authorization>
    </system.web>
</location>

See here: msft.


You can use forms authentication which allows you to specify if authenticated users can access pages by groups.

Unless of course you mean "real" directories that contain files. What are you securing? The file system, or the paths to the pages?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜