IIS 7的整合式模式可以將ASP.NET模組套用到任何任何內容包含ASP.NET網頁、靜態檔案、ASP、PHP程式。過去要提供這些伺服器等級的服務都需要使用C++撰寫.
舉例來說,若你從IE 輸入 http://localhost/iisstart.htm,你會看到網頁呈現如下

以下說明套用Forms驗證模組到任何類型的檔案,並且將Forms驗證從Web應用層式提升到伺服器層級的步驟,當你試圖存取htm類型的網頁,需先通過Forms驗證:
1) 在inetpub\wwwroot下建立一個login.aspx網頁,包含:

2)login按鈕的Click事件處理常式,要由帳號一定要是ucom,密碼為vivid

3) 加入以下Web.config檔到inetpub\wwwroot下

4)從IE 輸入 http://localhost/iisstart.htm,你會看到網頁呈現如下,要求先登入

5)加入以下test.asp檔到inetpub\wwwroot下,同樣地從IE 輸入 http://localhost/iisstart.htm,你會看網站要求先登入
沒有留言:
張貼留言