close
接著要針對此資料夾(Files)增加一個Web.config來註冊IHttpHandler,順便指定此資料夾不允許未登入使用者存取
<?xml version="1.0" encoding="utf-8"?>
<!-- 注意: 除了手動編輯這個檔案以外,您也可以使用 Web 管理工具
設定您的應用程式設定值。請使用 Visual Studio 中的
[網站] -> [ASP.NET 組態] 選項。
如需完整的設定與註解清單,請參考 machine.config.comments (通常
位於 \Windows\Microsoft.NET\Framework\v2.0.xxxxx\Config)
-->
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<httpHandlers>
<add verb="*" path="*.*" type="CFileSafe"/>
</httpHandlers>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</configuration>
<!-- 注意: 除了手動編輯這個檔案以外,您也可以使用 Web 管理工具
設定您的應用程式設定值。請使用 Visual Studio 中的
[網站] -> [ASP.NET 組態] 選項。
如需完整的設定與註解清單,請參考 machine.config.comments (通常
位於 \Windows\Microsoft.NET\Framework\v2.0.xxxxx\Config)
-->
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<httpHandlers>
<add verb="*" path="*.*" type="CFileSafe"/>
</httpHandlers>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</configuration>
From:http://www.dotblogs.com.tw/topcat/archive/2008/03/06/1255.aspx
全站熱搜