欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
aspx日志
using System; 

using System.Configuration; 

using System.IO; 

using System.Web; 

 

namespace SingingEels 



    
public class ErrorLogger 

    


        
public static void LogException(Exception ex) 

        


ErrorLoggerSection configInstance 
= ConfigurationManager.GetSection("WebSiteErrorLogger"as ErrorLoggerSection; 

 

            
if (configInstance != null

            


string myDirectory=HttpContext.Current.Server.MapPath(configInstance.LogFilePath + DateTime.Now.Year.ToString()+"/"+ DateTime.Now.Month.ToString()+"/"); 

string mypath=myDirectory+DateTime.Now.ToShortDateString()+".txt"

if (!Directory.Exists(myDirectory)) 



Directory.CreateDirectory(myDirectory); 

}
 

File.AppendAllText(mypath, 
string.Format("{0:yyyyMMdd_HHmmss} :: {1}{2}{2}", DateTime.Now, ex, Environment.NewLine)); 

 

            }
 

            
else 

            


throw new Exception("Could not find section ‘ErrorLoggerSection‘ in the application configuration file."); 

            }
 

        }
 

    }
 

 

    
// Inherit from "ConfigurationSection"
 simple enough! 


    
public class ErrorLoggerSection : ConfigurationSection 

    


        
// I only want one property
 LogFilePath, and I‘m 

        
// here telling .NET to look for an attribute in the 

        
// config file called ‘logFilePath‘ to get the value from. 

        [ConfigurationProperty(
"logFilePath", IsRequired = true)] 

        
public string LogFilePath 

        


            
get 

            


                
return (string)base["logFilePath"]; 

            }
 

 

            
set 

            


                
base["logFilePath"= value; 

            }
 

        }
 

    }
 

}
 


Web.config

<?xml version="1.0"?> 

<configuration> 

    
<configSections> 

        
<section name="WebSiteErrorLogger" type="SingingEels.ErrorLoggerSection"/> 

    
</configSections> 

    
<WebSiteErrorLogger logFilePath="~/Log/"/> 

 

    
<system.web> 

        
<compilation debug="true"/> 

    
</system.web> 

 

<system.web> 

<customErrors mode="RemoteOnly" defaultRedirect="~/Error.htm"></customErrors> 

</system.web> 

 

</configuration> 


Global.asax

<%@ Application Language="C#" %> 

 

<script runat="server"> 

 

void Application_Start(object sender, EventArgs e) 



// Code that runs on application startup 

 

}
 

 

void Application_End(object sender, EventArgs e) 



// Code that runs on application shutdown 

 

}
 

 

void Application_Error(object sender, EventArgs e) 



// Code that runs when an unhandled error occurs 

 

Exception err 
= Server.GetLastError().GetBaseException(); 

SingingEels.ErrorLogger.LogException(err); 

 

 

 

}
 

 

void Session_Start(object sender, EventArgs e) 



// Code that runs when a new session is started 

 

}
 

 

void Session_End(object sender, EventArgs e) 



// Code that runs when a session ends. 

// Note: The Session_End event is raised only when the sessionstate mode 

// is set to InProc in the Web.config file. If session mode is set to StateServer 

// or SQLServer, the event is not raised. 

 

}
 

 

</script>
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
各種ASP.NET 執行 定時(shí)任務(wù) 解決方案
微軟高校博客-J‘s Home-ASP.NET 在線(xiàn)用戶(hù)列表
ASP.NET頁(yè)面——頁(yè)面事件
.NET中的三種Timer的區別和用法
轉:C#中跨線(xiàn)程訪(fǎng)問(wèn)控件問(wèn)題解決方案
C#利用S7netplus讀寫(xiě)西門(mén)子PLC數據
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久