資源簡介
log4net 在winform中記錄全局錯(cuò)誤例子
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
using?Common;
namespace?testLog4N
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????LogHelper.WriteLog(string.Format(“當(dāng)前的時(shí)間{0}“?DateTime.Now.ToString()));
????????}
????????private?void?button2_Click(object?sender?EventArgs?e)
????????{
????????????throw?new?ArgumentNullException(“這是故意產(chǎn)生的異常“);
????????}
????}
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-10-28?11:12??testLog4N\
?????目錄???????????0??2013-10-28?11:17??testLog4N\testLog4N\
?????文件?????????869??2013-10-26?15:06??testLog4N\testLog4N.sln
?????文件???????15360??2013-10-28?19:32??testLog4N\testLog4N.suo
?????文件?????????161??2013-10-28?11:22??testLog4N\testLog4N\App.config
?????目錄???????????0??2013-10-28?09:45??testLog4N\testLog4N\bin\
?????目錄???????????0??2013-10-28?11:20??testLog4N\testLog4N\bin\Debug\
?????目錄???????????0??2013-10-28?15:05??testLog4N\testLog4N\bin\Debug\Log\
?????文件?????????368??2013-10-28?10:30??testLog4N\testLog4N\bin\Debug\log.txt
?????文件????????1908??2013-10-28?19:32??testLog4N\testLog4N\bin\Debug\log4net.config
?????文件??????249856??2013-10-26?15:06??testLog4N\testLog4N\bin\Debug\log4net.dll
?????文件?????1287495??2013-10-26?15:06??testLog4N\testLog4N\bin\Debug\log4net.xm
?????目錄???????????0??2013-10-28?20:00??testLog4N\testLog4N\bin\Debug\Log\LogError\
?????文件????????5652??2013-10-28?20:05??testLog4N\testLog4N\bin\Debug\Log\LogError\20131028.htm
?????目錄???????????0??2013-10-28?20:05??testLog4N\testLog4N\bin\Debug\Log\LogInfo\
?????文件???????????0??2013-10-28?20:05??testLog4N\testLog4N\bin\Debug\Log\LogInfo\20131028.htm
?????文件???????????0??2013-10-28?20:04??testLog4N\testLog4N\bin\Debug\Log\LogInfo\20131028.htm.1
?????文件???????????0??2013-10-28?19:28??testLog4N\testLog4N\bin\Debug\Log\LogInfo\20131028.htm.10
?????文件???????????0??2013-10-28?19:22??testLog4N\testLog4N\bin\Debug\Log\LogInfo\20131028.htm.11
?????文件???????????0??2013-10-28?19:21??testLog4N\testLog4N\bin\Debug\Log\LogInfo\20131028.htm.12
?????文件???????????0??2013-10-28?19:15??testLog4N\testLog4N\bin\Debug\Log\LogInfo\20131028.htm.13
?????文件???????????0??2013-10-28?19:13??testLog4N\testLog4N\bin\Debug\Log\LogInfo\20131028.htm.14
?????文件???????????0??2013-10-28?19:11??testLog4N\testLog4N\bin\Debug\Log\LogInfo\20131028.htm.15
?????文件???????????0??2013-10-28?19:10??testLog4N\testLog4N\bin\Debug\Log\LogInfo\20131028.htm.16
?????文件???????????0??2013-10-28?17:36??testLog4N\testLog4N\bin\Debug\Log\LogInfo\20131028.htm.17
?????文件???????????0??2013-10-28?17:26??testLog4N\testLog4N\bin\Debug\Log\LogInfo\20131028.htm.18
?????文件???????????0??2013-10-28?17:17??testLog4N\testLog4N\bin\Debug\Log\LogInfo\20131028.htm.19
?????文件???????????0??2013-10-28?20:02??testLog4N\testLog4N\bin\Debug\Log\LogInfo\20131028.htm.2
?????文件?????????167??2013-10-28?15:35??testLog4N\testLog4N\bin\Debug\Log\LogInfo\20131028.htm.20
?????文件???????10020??2013-10-28?15:07??testLog4N\testLog4N\bin\Debug\Log\LogInfo\20131028.htm.21
?????文件???????????0??2013-10-28?20:00??testLog4N\testLog4N\bin\Debug\Log\LogInfo\20131028.htm.3
............此處省略41個(gè)文件信息
評論
共有 條評論