More Related Content
Similar to Asp net原理 (20)
Asp net原理
- 17. 下載檔案名稱變亂碼
//使用UrlPathEncode編碼
string fileName = Server.UrlPathEncode("檔 案 名稱.doc");
//瀏覽器解晰後,會自動解晰為正確的檔案名稱
string contentDisposition = string.Format("attachment; fileName={0}", fileName);
Response.AddHeader("Content-Disposition", contentDisposition);
- 65. IIS 7- 註冊全域Http Module的兩種方式
ApplicationHost.config
<globalModules>
…………
</globalModules >
IIS 管理介面
參考連結:Global Modules <globalModules>
- 72. protected void Application_PostAuthenticateRequest ()
BeginReuest
AuthenticateRequest
PostAuthenticateRequest
AuthorizeRequest
PostAuthorizeRequest
ResolveRequestCache
PostResolveRequestCache
PostMapRequestHandler
AcquireRequestState
PostAcquireReqestState
PreRequestHanlderExecute
PostRequestHanlderExecute
ReleaseRequestState
PostReleaseRequestState
UpdateRequestCache
PostUpdateRequestCache
LogRequest
PostLogRequest
EndRequest
Event
PreSendRequestHeaders
PreSendRequestContent
- 73. Event
protected void Application_PostAuthenticateRequest ()
BeginReuest
AuthenticateRequest
PostAuthenticateRequest
AuthorizeRequest
PostAuthorizeRequest
ResolveRequestCache
PostResolveRequestCache
PostMapRequestHandler
AcquireRequestState
PostAcquireReqestState
PreRequestHanlderExecute
PostRequestHanlderExecute
ReleaseRequestState
PostReleaseRequestState
UpdateRequestCache
PostUpdateRequestCache
LogRequest
PostLogRequest
EndRequest
注意事項
必須是 System.EventHandler
存取的事件必須為 public
Editor's Notes
- 隔離:不同應用程式定義域之間不能直接去存去存取,跨應用程式定義域存取的物件必須衍生自System.MarshalByRefObject
缷載:被載入的組件只能以應用程式定義域為單位缷載
安全:以應用程式定義域為邊界的安全機制
配置:以應用程式定義域為邊界的程式配置
- 隔離:不同應用程式定義域之間不能直接去存去存取,跨應用程式定義域存取的物件必須衍生自System.MarshalByRefObject
缷載:被載入的組件只能以應用程式定義域為單位缷載
安全:以應用程式定義域為邊界的安全機制
配置:以應用程式定義域為邊界的程式配置
- HttpContext 處理完每一次的要求之後,會被丟棄,新的要求會再建立一個新的
HttpApplication 內會有處理管線讓程式人員有擴充的機制
- FileAuthorizationModule 驗證靜態檔案的工作會交由IIS,而不是aspnet_isapi.dll(HttpModule才會由它處理),因此預設只能處理動態檔案(*.aspx , *.ascx),但都要經由ACL去做權限驗證