- 解決IIS目錄枚舉
當前的IIS版本爲7.5
【IIS】 => 【請求篩選】 => 【URL】中添加 【拒絕序列】 符號 ~
- 應用程序錯誤
在Global.asax 中添加異常處理代碼,當程序出現異常後,記錄異常,跳轉到預先設置的頁面,避免暴漏太多的細節
void Application_Error(object sender, EventArgs e) { string errorMsg = String.Empty; Exception currentError = Server.GetLastError(); errorMsg += "來自頁面的異常處理<br />"; errorMsg += "系統發生錯誤:<br />"; errorMsg += "錯誤地址:" + Request.Url + "<br />"; errorMsg += "錯誤信息:" + currentError.Message + "<br />"; Log.WriteLog(errorMsg); Server.ClearError(); Response.Redirect("~/err.html"); }