ASP.NET中的應用程式配置

來源:互聯網
上載者:User
asp.net|程式 ASP.NET配置使用層次式配置體繫結構。ASP.NET的所有配置資訊都包含了在設定檔中,該檔案為config.web,它位於與應用程式檔案相同的目錄中。除非子目錄內的config.web檔案覆蓋了父目錄的設定,否則,子目錄降繼承父目錄的設定。
config.web檔案為每種主要的ASP.NET功能提供了對應部分。
config.web檔案中有關安全的內容如下所示:
<security>
<authentication mode=”[windows/cookie/passport/none]”>
<cookie cookie=”[name]” loginurl=”[url]” decryptionkey=”[key]”>
<credentials passwordformat =”[clear,shal,md5]”>
<user name=”[username]”password=”[password]”/>
</credentials>
</cookie>
<passport redirecturl=”internal”/>
</authentication>
<authorization>
<allow users=”[comma separated list of users]” roles=”[comma separated list of roles]”/>
<deny users=”[comma separated list of users]” roles=”[comma separated list of roles]”/>
</authentication>
<identity>
<impersonation enable =”[true/false]”/>
</identity>
</security>
這部分主要分為三部分:
»認證
»授權
»身份
通過應用程式根目錄的應用程式設定檔中類似的一部分來覆蓋電腦層次設定檔中的對應部分,就可以設定每個要素的值。所有子目錄降自動繼承設定,然而,子目錄也可以通過覆蓋其父目錄的設定來擁有自己的設定檔。




聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.