如何保护我的"hibernate.cfg.xml"文件?(Nhibernate的)

And*_*rew 10 .net security nhibernate

如何保护我的"hibernate.cfg.xml"文件?(NHibernate的).它目前位于Web应用程序的路径中,可以通过浏览器查看.

Die*_*hon 6

<configuration>
  <system.web>
    <httpHandlers>
      <add verb="*" path="hibernate.cfg.xml"
           type="System.Web.HttpForbiddenHandler"/>
    </httpHandlers>
  </system.web>
<configuration>
Run Code Online (Sandbox Code Playgroud)

  • 顺便说一句,这正是默认使用*.config文件所做的事情 (4认同)