<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_在路上</title><subtitle type="text"/><id>http://feed.cnblogs.com/blog/u/31024/rss</id><updated>2010-08-13T15:30:43Z</updated><author><name>shawnliu</name><uri>http://www.cnblogs.com/shawnliu/</uri></author><generator>CNBlogs BlogServer</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shawnliu/"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/31024/rss"/><entry><id>http://www.cnblogs.com/shawnliu/archive/2010/08/13/1799366.html</id><title type="text">log4net使用guidline（写的很详细）</title><summary type="text">声明：本文内容主要译自Nauman Leghari的Using log4net，亦加入了个人的一点心得(节3.1.4)。请在这里下载示例代码1简介1.1Log4net的优点：几乎所有的大型应用都会有自己的用于跟踪调试的API。因为一旦程序被部署以后，就不太可能再利用专门的调试工具了。然而一个管理员可能需要有一套强大的日志系统来诊断和修复配置上的问题。经验表明，日志记录往往是软件开发周期中的重要组成...</summary><published>2010-08-13T15:31:00Z</published><updated>2010-08-13T15:31:00Z</updated><author><name>shawnliu</name><uri>http://www.cnblogs.com/shawnliu/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shawnliu/archive/2010/08/13/1799366.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shawnliu/archive/2010/08/13/1799366.html"/><content type="html">&lt;span  style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; line-height: 18px; font-size: 13px; "&gt;声明：本文内容主要译自Nauman Leghari的Using log4net，亦加入了个人的一点心得(节3.1.4)。&lt;br /&gt;请在这里下载&lt;a href="http://files.cnblogs.com/dragon/Log4NetTester.rar" style="color: navy; text-decoration: none; "&gt;示例代码&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21.25pt; text-indent: -21.25pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;1&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;简介&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 49.6pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;1.1&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Log4net&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的优点：&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;几乎所有的大型应用都会有自己的用于跟踪调试的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;API&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;。因为一旦程序被部署以后，就不太可能再利用专门的调试工具了。然而一个管理员可能需要有一套强大的日志系统来诊断和修复配置上的问题。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;经验表明，日志记录往往是软件开发周期中的重要组成部分。它具有以下几个优点：它可以提供应用程序运行时的精确环境，可供开发人员尽快找到应用程序中的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Bug&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;；一旦在程序中加入了&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Log&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;输出代码，程序运行过程中就能生成并输出日志信息而无需人工干预。另外，日志信息可以输出到不同的地方（控制台，文件等）以备以后研究之用。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;就是为这样一个目的设计的，用于&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;.NET&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;开发环境的日志记录包。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 49.6pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;1.2&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Log4net&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的安装：&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;用户可以从&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;a href="http://logging.apache.org/log4net/" style="color: navy; text-decoration: none; "&gt;&lt;span style="line-height: 15px; font-size: 13px; color: windowtext; text-decoration: none; "&gt;http://logging.apache.org/log4net/&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;下载&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的源代码。解压软件包后，在解压的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;src&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;目录下将&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.sln&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;载入&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Visual Studio .NET&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;，编译后可以得到&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.dll&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;。用户要在自己的程序里加入日志功能，只需将&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.dll&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;引入工程即可。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21.25pt; text-indent: -21.25pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;2&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Log4net&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的结构&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;有四种主要的组件，分别是&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;（记录器）&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;, Repository&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;（库）&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;, Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;（附着器）以及&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;Layout&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;（布局）&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 49.6pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;2.1&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger&lt;a name="Logger" style="width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.cnblogs.com/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;amp;file=anchor.gif); background-repeat: no-repeat no-repeat; "&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 70.9pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;2.1.1&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;接口&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;是应用程序需要交互的主要组件，它用来产生日志消息。产生的日志消息并不直接显示，还要预先经过&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Layout&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的格式化处理后才会输出。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;提供了多种方式来记录一个日志消息，你可以在你的应用程序里创建多个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;，每个实例化的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象都被&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;框架作为命名实体&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;(named entity)&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;来维护。这意味着为了重用&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象，你不必将它在不同的类或对象间传递，只需要用它的名字为参数调用就可以了。&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;框架使用继承体系，继承体系类似于&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;.NET&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;中的名字空间。也就是说，如果有两个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;logger,&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;分别被定义为&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;a.b.c&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;和&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;a.b&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;，那么我们说&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;a.b&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;是&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;a.b.c&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的祖先。每一个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;都继承了祖先的属性&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;框架定义了一个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ILog&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;接口，所有的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;类都必须实现这个接口。如果你想实现一个自定义的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;，你必须首先实现这个接口。你可以参考在&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;/extension&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;目录下的几个例子。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ILog&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;接口的定义如下：&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;public interface ILog&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;void Debug(object message);&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;void Info(object message);&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;void Warn(object message);&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;void Error(object message);&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;void Fatal(object message);&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;//&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;以上的每一个方法都有一个重载的方法，用来支持异常处理。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;//&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;每一个重载方法都如下所示，有一个异常类型的附加参数。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;void Debug(object message, Exception ex);&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;// ...&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;//Boolean&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;属性用来检查&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的日志级别&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;//&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;（我们马上会在后面看到日志级别）&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;bool isDebugEnabled;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;bool isInfoEnabled;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;//&amp;#8230;&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;其他方法对应的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Boolean&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;属性&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;框架定义了一个叫做&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;LogManager&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的类，用来管理所有的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象。它有一个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;GetLogger()&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;静态方法，用我们提供的名字参数来检索已经存在的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象。如果框架里不存在该&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象，它也会为我们创建一个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象。代码如下所示：&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.ILog log = log4net.LogManager.GetLogger("logger-name");&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;通常来说，我们会以类（&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;class&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;）的类型（&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;type&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;）为参数来调用&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;GetLogger()&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;，以便跟踪我们正在进行日志记录的类。传递的类&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;(class)&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的类型&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;(type)&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;可以用&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;typeof(Classname)&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;方法来获得，或者可以用如下的反射方法来获得：&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;System.Reflection.MethodBase.GetCurrentMethod().DeclaringType&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;尽管符号长了一些，但是后者可以用于一些场合，比如获取调用方法的类&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;(class)&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的类型&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;(type)&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 70.9pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;2.1.2&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;日志的级别&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;正如你在&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ILog&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的接口中看到的一样，有五种不同的方法可以跟踪一个应用程序。事实上，这五种方法是运作在&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象设置的不同日志优先级别上。这几种不同的级别是作为常量定义在&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.spi.Level&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;类中。你可以在程序中使用任何一种方法。但是在最后的发布中你也许不想让所有的代码来浪费你的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;CPU&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;周期，因此，框架提供了&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;7&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;种级别和相应的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Boolean&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;属性来控制日志记录的类型。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Level&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;有以下几种取值&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;table  cellpadding="0" border="1" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; margin-left: 48.75pt; "&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width="69" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 51.75pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;级别&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="118" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 88.5pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;允许的方法&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="154" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 115.5pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Boolean&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;属性&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="81" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 60.75pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;优先级别&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="69" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 51.75pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;OFF&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="118" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 88.5pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="154" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 115.5pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="81" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 60.75pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Highest&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="69" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 51.75pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;FATAL&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="118" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 88.5pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;void Fatal(...);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="154" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 115.5pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;bool IsFatalEnabled;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="81" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 60.75pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="69" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 51.75pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;RROR&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="118" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 88.5pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;void Error(...);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="154" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 115.5pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;bool IsErrorEnabled;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="81" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 60.75pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="69" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 51.75pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;WARN&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="118" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 88.5pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;void Warn(...);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="154" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 115.5pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;bool IsWarnEnabled;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="81" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 60.75pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="69" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 51.75pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;INFO&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="118" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 88.5pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;void Info(...);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="154" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 115.5pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;bool IsInfoEnabled;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="81" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 60.75pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="69" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 51.75pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;DEBUG&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="118" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 88.5pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;void Debug(...);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="154" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 115.5pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;bool IsDebugEnabled;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="81" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 60.75pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="69" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 51.75pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ALL&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="118" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 88.5pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="154" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 115.5pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td width="81" style="border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f7c75; border-right-color: #7f7c75; border-bottom-color: #7f7c75; border-left-color: #7f7c75; font-size: 12px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; padding-right: 1.5pt; padding-left: 1.5pt; padding-bottom: 1.5pt; width: 60.75pt; padding-top: 1.5pt; "&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Lowest&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p  align="center" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; text-align: center; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;表&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;1&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;Logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的日志级别&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;在&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;框架里，通过设置配置文件，每个日志对象都被分配了一个日志优先级别。如果没有给一个日志对象显式地分配一个级别，那么该对象会试图从他的祖先继承一个级别值。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ILog&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;接口的每个方法都有一个预先定义好了的级别值。正如你在表&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;1&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;看到的，&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ILog&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Inof()&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;方法具有&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;INFO&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;级别。同样的，以此类推，&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Error()&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;方法具有&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ERROR&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;级别。当我们使用以上的任何一种方法时，&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;框架会检查日志对象&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的级别和方法的级别。只有当方法的级别高于日志级别时，日志请求才会被接受并执行。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;举例说明，当你创建了一个日志对象，并且把他的级别设置为&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;INFO&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;。于是框架会设置日志的每个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Boolean&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;属性。当你调用相应的日志方法时，框架会检查相应的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Boolean&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;属性，以决定该方法能不能执行。如下的代码：&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger.Info("message");&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger.Debug("message");&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger.Warn("message");&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对于第一种方法，&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Info()&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的级别等与日志的级别（&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;INFO&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;），因此日志请求会被传递，我们可以得到输出结果&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;#8221;message&amp;#8221;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对于第二种方法，&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Debug()&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的级别低于日志对象&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的日志级别&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;(INFO)&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;，因此，日志请求被拒绝了，我们得不到任何输出。同样的，针对第三行语句，我们可以很容易得出结论。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;在表&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;1&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;中有两个特殊的级别：&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ALL&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;和&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;OFF&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;。&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ALL&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;表示允许所有的日志请求。&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;OFF&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;是拒绝所有的请求。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;你也可以显式地检查&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Boolean&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;属性，如下所示：&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;if (logger.IsDebugEnabled)&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;Logger.Debug("message");&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 49.6pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;2.2&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Repository&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Repository&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;主要用于负责日志对象组织结构的维护。在&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的以前版本中，框架仅支持分等级的组织结构&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;(hierarchical organization)&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;。这种等级结构本质上是库的一个实现，并且定义在&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.Repository.Hierarchy&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;名字空间中。要实现一个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Repository&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;，需要实现&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.Repository.ILoggerRepository&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;接口。但是通常并不是直接实现该接口，而是以&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.Repository.LoggerRepositorySkeleton&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;为基类继承。体系库&lt;/span&gt;&amp;nbsp;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;(hierarchical repository )&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;则由&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.Repository.Hierarchy.Hierarchy&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;类实现。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;如果你是个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;框架的使用者，而非扩展者，那么你几乎不会在你的代码里用到&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Repository&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的类。相反的，你需要用到&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;LogManager&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;类来自动管理库和日志对象。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 49.6pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;2.3&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;a name="Appender" style="width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.cnblogs.com/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;amp;file=anchor.gif); background-repeat: no-repeat no-repeat; "&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;一个好的日志框架应该能够产生多目的地的输出。比如说输出到控制台或保存到一个日志文件。&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;能够很好的满足这些要求。它使用一个叫做&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的组件来定义输出介质。正如名字所示，这些组件把它们附加到&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;日志组件上并将输出传递到输出流中。你可以把多个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;组件附加到一个日志对象上。&lt;/span&gt;&amp;nbsp;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;框架提供了几个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;组件。关于&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;提供的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;组件的完整列表可以在&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;框架的帮助手册中找到。有了这些现成的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;组件，一般来说你没有必要再自己编写了。但是如果你愿意，可以从&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.Appender.AppenderSkeleton&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;类继承。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 49.6pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;2.4&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender Filters&lt;a name="Filters" style="width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.cnblogs.com/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;amp;file=anchor.gif); background-repeat: no-repeat no-repeat; "&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;一个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象缺省地将所有的日志事件传递到输出流。&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的过滤器&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;(Appender Filters)&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;可以按照不同的标准过滤日志事件。在&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.Filter&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的名字空间下已经有几个预定义的过滤器。使用这些过滤器，你可以按照日志级别范围过滤日志事件，或者按照某个特殊的字符串进行过滤。你可以在&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;API&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的帮助文件中发现更多关于过滤器的信息。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 49.6pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;2.5&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Layout&lt;a name="Layout" style="width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.cnblogs.com/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;amp;file=anchor.gif); background-repeat: no-repeat no-repeat; "&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Layout&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;组件用于向用户显示最后经过格式化的输出信息。输出信息可以以多种格式显示，主要依赖于我们采用的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Layout&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;组件类型。可以是线性的或一个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;XML&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;文件。&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Layout&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;组件和一个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;组件一起工作。&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;API&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;帮助手册中有关于不同&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Layout&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;组件的列表。一个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象，只能对应一个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Layout&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象。要实现你自己的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Layout&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;类，你需要从&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.Layout.LayoutSkeleton&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;类继承，它实现了&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ILayout&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;接口。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21.25pt; text-indent: -21.25pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;3&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;在程序中使用&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;在开始对你的程序进行日志记录前，需要先启动&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;引擎。这意味着你需要先配置前面提到的三种组件。你可以用两种方法来设定配置：在单独的文件中设定配置或在代码中定义配置。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;因为下面几种原因，推荐在一个单独的文件中定义配置：&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 63pt; text-indent: -21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; font-family: Wingdings; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;l&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;你不需要重新编译源代码就能改变配置；&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 63pt; text-indent: -21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; font-family: Wingdings; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;l&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;你可以在程序正运行的时候就改变配置。这一点在一些&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;WEB&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;程序和远程过程调用的程序中有时很重要；&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;考虑到第一种方法的重要性，我们先看看怎样在文件中设定配置信息。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 49.6pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;3.1&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;定义配置文件&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;配置信息可以放在如下几种形式文件的一种中。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;在程序的配置文件里，如&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;AssemblyName.config&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;或&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;web.config.&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;在你自己的文件里。文件名可以是任何你想要的名字，如&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;AppName.exe.xyz&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;等&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;框架会在相对于&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;AppDomain.CurrentDomain.BaseDirectory&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;属性定义的目录路径下查找配置文件。框架在配置文件里要查找的唯一标识是&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;log4net&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签。一个完整的配置文件的例子如下：&lt;/span&gt;&lt;/p&gt;&lt;p  align="left" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; text-align: left; "&gt;&lt;span lang="EN-US" style="line-height: 19px; font-size: 12pt; color: #003366; font-family: 'Courier New'; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;configuration&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;configSections&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;section name="log4net"&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;type="log4net.Config.Log4NetConfigurationSectionHandler,&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;log4net-net-1.0"&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;/configSections&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;log4net&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;root&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;level value="WARN" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;appender-ref ref="LogFileAppender" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;appender-ref ref="ConsoleAppender" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;/root&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;logger name="testApp.Logging"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;level value="DEBUG"/&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;/logger&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;appender name="LogFileAppender"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;type="log4net.Appender.FileAppender" &amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;param name="File" value="log-file.txt" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&lt;/span&gt;&amp;lt;param name="AppendToFile" value="true" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;layout type="log4net.Layout.PatternLayout"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;param name="Header" value="[Header]\r\n"/&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;param name="Footer" value="[Footer]\r\n"/&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;param name="ConversionPattern"&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;value="%d [%t] %-5p %c [%x]&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;- %m%n"&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;/layout&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;filter type="log4net.Filter.LevelRangeFilter"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;param name="LevelMin" value="DEBUG" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;param name="LevelMax" value="WARN" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;/filter&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;/appender&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;appender name="ConsoleAppender"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;type="log4net.Appender.ConsoleAppender" &amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;layout type="log4net.Layout.PatternLayout"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;param name="ConversionPattern"&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;value="%d [%t] %-5p %c [%x] - %m%n"&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;/layout&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&lt;/span&gt;&amp;lt;/appender&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;/log4net&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;/configuration&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;你可以直接将上面的文本拷贝到任何程序中使用，但是最好还是能够理解配置文件是怎样构成的。&lt;/span&gt;&amp;nbsp;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;只有当你需要在应用程序配置文件中使用&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;配置时，才需要在&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;configSection&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签中加入&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;section&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;配置节点入口。对于其他的单独文件，只有&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;log4net&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签内的文本才是必需的，这些标签的顺序并不是固定的。下面我们依次讲解各个标签内文本的含义：&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 70.9pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;3.1.1&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;root&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;root&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;level value="WARN" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;appender-ref ref="LogFileAppender" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;appender-ref ref="ConsoleAppender" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;/root&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;在框架的体系里，所有的日志对象都是根日志&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;(root logger)&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的后代。&lt;/span&gt;&amp;nbsp;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;因此如果一个日志对象没有在配置文件里显式定义，则框架使用根日志中定义的属性。在&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;root&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签里，可以定义&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;level&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;级别值和&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的列表。如果没有定义&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;LEVEL&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的值，则缺省为&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;DEBUG&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;。可以通过&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;appender-ref&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签定义日志对象使用的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象。&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;appender-ref&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;声明了在其他地方定义的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象的一个引用。在一个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象中的设置会覆盖根日志的设置。而对&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;属性来说，子日志对象则会继承父日志对象的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;列表。这种缺省的行为方式也可以通过显式地设定&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;logger&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;additivity&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;属性为&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;false&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;而改变。&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;logger name="testApp.Logging" additivity="false"&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;/logger&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Additivity&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的值缺省是&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;true.&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 70.9pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;3.1.2&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;Logger&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;logger name="testApp.Logging"&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;level value="DEBUG"/&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;/logger&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;logger&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;元素预定义了一个具体日志对象的设置。然后通过调用&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;LogManager.GetLogger(&amp;#8220;testAPP.Logging&amp;#8221;)&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;函数，你可以检索具有该名字的日志。如果&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;LogManager.GetLogger(&amp;#8230;)&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;打开的不是预定义的日志对象，则该日志对象会继承根日志对象的属性。知道了这一点，我们可以说，其实&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;logger&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签并不是必须的。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 70.9pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;3.1.3&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;appender&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;appender name="LogFileAppender"&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;type="log4net.Appender.FileAppender" &amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;param name="File" value="log-file.txt" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;param name="AppendToFile" value="true" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;layout type="log4net.Layout.PatternLayout"&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;param name="Header" value="[Header]\r\n" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;param name="Footer" value="[Footer]\r\n"/&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;param name="ConversionPattern"&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;value="%d [%t] %-5p %c - %m%n"&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;/layout&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;filter type="log4net.Filter.LevelRangeFilter"&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;param name="LevelMin" value="DEBUG" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;param name="LevelMax" value="WARN" /&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;lt;/filter&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;/appender&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;在&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;root&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签或单个的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;logger&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签里的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象可以用&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;appender&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签定义。&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;appender&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签的基本形式如上面所示。它定义了&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的名字和类型。&lt;/span&gt;&amp;nbsp;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;另外比较重要的是&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;appender&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签内部的其他标签。不同的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;有不同的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;param&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签。在这里，为了使用&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;FileAppender,&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;你需要一个文件名作为参数。另外还需要一个在&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;appender&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签内部定义一个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Layout&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象。&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Layout&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象定义在它自己的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;layout&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签内。&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;layout&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;type&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;属性定义了&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Layout&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的类型&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;(&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;在本例里是&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;PatternLayout)&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;，同时也确定了需要提供的参数值。&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Header&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;和&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Footer&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签提供了一个日志会话&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;(logging session)&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;开始和结束时输出的文字。有关每种&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的具体配置的例子，可以在&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net\doc\manual\example-config-appender.html&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;中得到。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 70.9pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;3.1.4&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.Layout.PatternLayout&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;中的转换模式&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;(ConversionPattern)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;%m(message):&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;输出的日志消息，如&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ILog.Debug(&amp;#8230;)&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;输出的一条消息&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;%n(new line):&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;换行&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;%d(datetime):&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;输出当前语句运行的时刻&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;%r(run time):&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;输出程序从运行到执行到当前语句时消耗的毫秒数&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;%t(thread id):&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;当前语句所在的线程&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ID&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;%p(priority):&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;日志的当前优先级别，即&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;DEBUG&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;、&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;INFO&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;、&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;WARN&amp;#8230;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;等&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;%c(class):&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;当前日志对象的名称，例如：&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;模式字符串为：&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;%&lt;st1:chmetcnv w:st="on" unitname="C" sourcevalue="10" hasspace="False" negative="True" numbertype="1" tcsc="0"&gt;-10c&lt;/st1:chmetcnv&gt;&amp;nbsp;-%m%n&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;代码为：&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 73.5pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ILog log=LogManager.GetLogger(&amp;#8220;Exam.Log&amp;#8221;);&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 73.5pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log.Debug(&amp;#8220;Hello&amp;#8221;);&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 73.5pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;则输出为下面的形式：&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 73.5pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Exam.Log&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;- Hello&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;%L&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;：输出语句所在的行号&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;%F&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;：输出语句所在的文件名&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;%-&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;数字：表示该项的最小长度，如果不够，则用空格填充&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;例如，转换模式为&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;%r [%t]%-5p %c - %m%n&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;PatternLayout&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;将生成类似于以下内容的输出：&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;176 [main] INFO&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;org.foo.Bar - Located nearest gas station.&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 70.9pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;3.1.5&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;filter&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;最后，让我们看看在&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;元素里的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;lt;filter&amp;gt;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;标签。它定义了应用到&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象的过滤器。本例中，我们使用了&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;LevelRangeFilter&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;过滤器&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;,&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;它可以只记录&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;LevelMin&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;和&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;LevelMax&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;参数指定的日志级别之间的日志事件。可以在一个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;上定义多个过滤器（&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Filter&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;）&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;,&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;这些过滤器将会按照它们定义的顺序对日志事件进行过滤。其他过滤器的有关信息可以在&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;SDK&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;文档中找到。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 49.6pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;3.2&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;使用配置文件&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 70.9pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;3.2.1&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;关联配置文件&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;当我们创建了上面的配置文件后，我们接下来需要把它和我们的应用联系起来。缺省的，每个独立的可执行程序集都会定义它自己的配置。&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;框架使用&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.Config.DOMConfiguratorAttribute&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;在程序集的级别上定义配置文件。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;例如：可以在项目的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;AssemblyInfo.cs&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;文件里添加以下的语句&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;[assembly:log4net.Config.DOMConfigurator(ConfigFile="filename",&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;ConfigFileExtension="ext",Watch=true/false)]&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 84pt; text-indent: -21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; font-family: Wingdings; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;l&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ConfigFile:&lt;/span&gt;&lt;/strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;指出了我们的配置文件的路径及文件名，包括扩展名。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 84pt; text-indent: -21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; font-family: Wingdings; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;l&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ConfigFileExtension:&lt;/span&gt;&lt;/strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;如果我们对被编译程序的程序集使用了不同的文件扩展名，那么我们需要定义这个属性，缺省的，程序集的配置文件扩展名为&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;#8221;config&amp;#8221;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;。&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 84pt; text-indent: -21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; font-family: Wingdings; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;l&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Watch (Boolean&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;属性&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;):&lt;/span&gt;&lt;/strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;框架用这个属性来确定是否需要在运行时监视文件的改变。如果这个属性为&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;true,&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;那么&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;FileSystemWatcher&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;将会被用来监视文件的改变，重命名，删除等事件。&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;其中：&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ConfigFile&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;和&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ConfigFileExtension&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;属性不能同时使用，&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ConfigFile&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;指出了配置文件的名字，例如，&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ConfigFile=&amp;#8221;Config.txt&amp;#8221;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ConfigFileExtension&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;则是指明了和可执行程序集同名的配置文件的扩展名，例如，应用程序的名称是&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;#8221;test.exe&amp;#8221;,ConfigFileExtension=&amp;#8221;txt&amp;#8221;,&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;则配置文件就应该是&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&amp;#8221;test.exe.txt&amp;#8221;&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;；&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;也可以不带参数应用&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;DOMConfiguratio():&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&lt;/span&gt;[assembly: log4net.Config.DOMConfigurator()]&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;也可以在程序代码中用&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;DOMConfigurator&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;类打开配置文件。类的构造函数需要一个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;FileInfo&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象作参数，以指出要打开的配置文件名。&lt;/span&gt;&amp;nbsp;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;这个方法和前面在程序集里设置属性打开一个配置文件的效果是一样的。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.Config.DOMConfigurator.Configure(&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;new FileInfo("TestLogger.Exe.Config"));&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;DOMConfigurator&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;类还有一个方法&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ConfigureAndWatch(..),&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;用来配置框架并检测文件的变化。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;以上的步骤总结了和配置相关的各个方面，下面我们将分两步来使用&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;logger&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 70.9pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;3.2.2&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;创建或获取日志对象&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;日志对象会使用在配置文件里定义的属性。如果某个日志对象没有事先在配置文件里定义，那么框架会根据继承结构获取祖先节点的属性，最终的，会从根日志获取属性。如下所示：&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Log4net.ILog log = Log4net.LogManager.GetLogger("MyLogger");&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 70.9pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;3.2.3&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;输出日志信息&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;可以使用&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ILog&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的几种方法输出日志信息。你也可以在调用某方法前先检查&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;IsXXXEnabled&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;布尔变量，再决定是否调用输出日志信息的函数，这样可以提高程序的性能。因为框架在调用如&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ILog.Debug(&amp;#8230;)&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;这样的函数时，也会先判断是否满足&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Level&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;日志级别条件。&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;if (log.IsDebugEnabled) log.Debug("message");&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;if (log.IsInfoEnabled) log.Info("message);&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 42pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 49.6pt; text-indent: -1cm; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;3.3&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;在程序中配置&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;除了前面讲的用一个配置文件来配置&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;以外，还可以在程序中用代码来配置&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;框架。如下面的例子&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;:&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;//&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;和&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;PatternLayout&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;一起使用&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;FileAppender&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.Config.BasicConfigurator.Configure(&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;new log4net.Appender.FileAppender(&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;new log4net.Layout.PatternLayout("%d&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;[%t]%-5p %c [%x] - %m%n"),"testfile.log"));&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;// using a FileAppender with an XMLLayout&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.Config.BasicConfigurator.Configure(&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;new log4net.Appender.FileAppender(&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;new log4net.Layout.XMLLayout(),"testfile.xml"));&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;// using a ConsoleAppender with a PatternLayout&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.Config.BasicConfigurator.Configure(&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;new log4net.Appender.ConsoleAppender(&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;new log4net.Layout.PatternLayout("%d&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;[%t] %-5p %c - %m%n")));&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;// using a ConsoleAppender with a SimpleLayout&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.Config.BasicConfigurator.Configure(&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;new log4net.Appender.ConsoleAppender(new&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;log4net.Layout.SimpleLayout()));&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;尽管这里用代码配置&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;也很方便，但是你却不能分别配置每个日志对象。所有的这些配置都是被应用到根日志上的。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.Config.BasicConfigurator&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;类使用静态方法&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Configure&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;设置一个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象。而&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Appender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;的构造函数又会相应的要求&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Layout&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象。你也可以不带参数直接调用&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;BasicConfigurator.Configure()&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;，它会使用一个缺省的&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;PatternLayout&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;对象，在一个&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;ConsoleAppender&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;中输出信息。如下所示：&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net.Config.BasicConfigurator.Configure();&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;在输出时会显示如下格式的信息：&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;0 [1688] DEBUG log&lt;st1:chmetcnv w:st="on" unitname="a" sourcevalue="1" hasspace="True" negative="False" numbertype="1" tcsc="0"&gt;1 A&lt;/st1:chmetcnv&gt;&amp;nbsp;B C - Test&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;20 [1688] INFO log&lt;st1:chmetcnv w:st="on" unitname="a" sourcevalue="1" hasspace="True" negative="False" numbertype="1" tcsc="0"&gt;1 A&lt;/st1:chmetcnv&gt;&amp;nbsp;B C - Test&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;当&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;框架被配置好以后，就可以如前所述使用日志功能了。&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; font-size: 13px; line-height: 1.4; "&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21.25pt; text-indent: -21.25pt; font-size: 13px; line-height: 1.4; "&gt;&lt;strong&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;span style="line-height: 15px; font-size: 13px; "&gt;4&lt;span style="line-height: normal; font-size: 13px; font: normal normal normal 7pt/normal 'Times New Roman'; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;总结&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p  style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: 21pt; text-indent: 21pt; font-size: 13px; line-height: 1.4; "&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;使用&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;可以很方便地为应用添加日志功能。应用&lt;/span&gt;&lt;span lang="EN-US" style="line-height: 15px; font-size: 13px; "&gt;Log4net&lt;/span&gt;&lt;span style="line-height: 15px; font-size: 13px; font-family: 宋体; "&gt;，使用者可以很精确地控制日志信息的输出，减少了多余信息，提高了日志记录性能。同时，通过外部配置文件，用户可以不用重新编译程序就能改变应用的日志行为，使得用户可以根据情况灵活地选择要记录的信息。&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;img src="http://www.cnblogs.com/shawnliu/aggbug/1799366.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shawnliu/archive/2010/08/13/1799366.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/shawnliu/archive/2010/08/13/1799362.html</id><title type="text">Log4net 简明手册(来自yuhen，写的非常好)</title><summary type="text">常见面，却不怎么用，究其原因还是觉得太复杂了点。不过，这东西出现次数越来越频繁，也只好写点东西，以备后用。本文仅对 Log4net 的使用做个简要说明，所有涉及到扩展和开发的部分一概忽略。使用 Log4net，需要熟悉的东东有 Logger、Appender 以及 Layout。Logger 是日志记录器，我们使用其相关方法来完成日志记录；Appender 用于设置日志的存储方式和位置，Logge...</summary><published>2010-08-13T15:07:00Z</published><updated>2010-08-13T15:07:00Z</updated><author><name>shawnliu</name><uri>http://www.cnblogs.com/shawnliu/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shawnliu/archive/2010/08/13/1799362.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shawnliu/archive/2010/08/13/1799362.html"/><content type="html">&lt;span  style="font-family: Tahoma, Verdana, Segoe, sans-serif; line-height: 18px; font-size: 12px; "&gt;常见面，却不怎么用，究其原因还是觉得太复杂了点。不过，这东西出现次数越来越频繁，也只好写点东西，以备后用。本文仅对 Log4net 的使用做个简要说明，所有涉及到扩展和开发的部分一概忽略。&lt;br /&gt;&lt;br /&gt;使用 Log4net，需要熟悉的东东有 Logger、Appender 以及 Layout。Logger 是日志记录器，我们使用其相关方法来完成日志记录；Appender 用于设置日志的存储方式和位置，Logger 的配置中会绑定一个或多个 Appender；Layout 关联具体的 Appender，用于设置日志字符串的格式。&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Logger&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;所有的记录器都必须实现 ILog 接口，该接口提供日志记录所需的大量方法。&lt;br /&gt;&lt;pre  style="white-space: pre-wrap; word-wrap: break-word; line-height: 18px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; font-family: 'Courier New', 'DejaVu Sans Mono', Tahoma, Verdana, Segoe, sans-serif; color: #000000; background-color: #f9f9f9; border-left-width: 3px; border-left-style: solid; border-left-color: #e0e0e0; border-top-width: 1px; border-top-style: solid; border-top-color: #e0e0e0; border-right-width: 1px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;public interface ILog : ILoggerWrapper&#xD;
{&#xD;
    void Debug(...);&#xD;
    void Error(...);&#xD;
    void Fatal(...);&#xD;
    void Info(...);&#xD;
    void Warn(...);&#xD;
&#xD;
    bool IsDebugEnabled { get; }&#xD;
    bool IsErrorEnabled { get; }&#xD;
    bool IsFatalEnabled { get; }&#xD;
    bool IsInfoEnabled { get; }&#xD;
    bool IsWarnEnabled { get; }&#xD;
}&lt;/pre&gt;&lt;br /&gt;通常情况下，我们通过 LogManager.GetLogger() 来获取一个记录器。LogManager 内部维护一个 hashtable，保存新创建 Logger 引用，下次需要时直接从 hashtable 获取其实例。&lt;br /&gt;&lt;pre  style="white-space: pre-wrap; word-wrap: break-word; line-height: 18px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; font-family: 'Courier New', 'DejaVu Sans Mono', Tahoma, Verdana, Segoe, sans-serif; color: #000000; background-color: #f9f9f9; border-left-width: 3px; border-left-style: solid; border-left-color: #e0e0e0; border-top-width: 1px; border-top-style: solid; border-top-color: #e0e0e0; border-right-width: 1px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;ILog log = LogManager.GetLogger(this.GetType());&#xD;
log.Debug("aaaaaaaaaaaaaaa");&lt;/pre&gt;&lt;br /&gt;所有 Logger 的参数设置都直接或间接继承自 root，其继承关系类似 namespace。比如，名为 "MyLogger.X.Y" 参数设置继承自 "MyLogger.X"。当我们创建 "MyLooger.X.Y" 记录器时，会在配置文件找该名称的记录器设置，如果没找到，则按继承关系向上查找，直到 root。因此，在创建 Logger 时，我们通常使用类型名称做为记录器的名字，缺省情况下，它会使用 root 或某一个父配置，但在需要的时候，我们随时可以为具体的类型添加一个更加 "详细" 的配置。&lt;br /&gt;&lt;pre  style="white-space: pre-wrap; word-wrap: break-word; line-height: 18px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; font-family: 'Courier New', 'DejaVu Sans Mono', Tahoma, Verdana, Segoe, sans-serif; color: #000000; background-color: #f9f9f9; border-left-width: 3px; border-left-style: solid; border-left-color: #e0e0e0; border-top-width: 1px; border-top-style: solid; border-top-color: #e0e0e0; border-right-width: 1px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt; &#xD;
&amp;lt;log4net&amp;gt;&#xD;
    &amp;lt;appender name="Console" type="log4net.Appender.ConsoleAppender"&amp;gt;&#xD;
        &amp;lt;layout type="log4net.Layout.PatternLayout"&amp;gt;&#xD;
            &amp;lt;conversionPattern value="%5level [%thread] (%file:%line) - %message%newline" /&amp;gt;&#xD;
        &amp;lt;/layout&amp;gt;&#xD;
    &amp;lt;/appender&amp;gt;&#xD;
&#xD;
    &amp;lt;logger name="Learn.Library.Log4netTest"&amp;gt;&#xD;
        &amp;lt;level value="ALL" /&amp;gt;&#xD;
    &amp;lt;/logger&amp;gt;&#xD;
&#xD;
    &amp;lt;root&amp;gt;&#xD;
        &amp;lt;level value="OFF" /&amp;gt;&#xD;
        &amp;lt;appender-ref ref="Console" /&amp;gt;&#xD;
    &amp;lt;/root&amp;gt;&#xD;
&amp;lt;/log4net&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;在创建 Logger 设置时，需要注意 "level" 参数。Log4net 允许我们通过该参数调整日志记录级别，只有高于或等于该级别的日志才会被记录下来。比如在代码调试阶段，我们可能希望记录所有的信息，而在部署阶段，我们只希望记录级别更高的错误信息。这个参数的好处是允许我们在不修改代码的前提下，随时调整记录级别。&lt;br /&gt;&lt;pre  style="white-space: pre-wrap; word-wrap: break-word; line-height: 18px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; font-family: 'Courier New', 'DejaVu Sans Mono', Tahoma, Verdana, Segoe, sans-serif; color: #000000; background-color: #f9f9f9; border-left-width: 3px; border-left-style: solid; border-left-color: #e0e0e0; border-top-width: 1px; border-top-style: solid; border-top-color: #e0e0e0; border-right-width: 1px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;(高) OFF &amp;gt; FATAL &amp;gt; ERROR &amp;gt; WARN &amp;gt; INFO &amp;gt; DEBUG &amp;gt; ALL (低)&lt;/pre&gt;&lt;br /&gt;"appender-ref" 参数用于绑定一个或多个具体的 Appender。&lt;br /&gt;&lt;pre  style="white-space: pre-wrap; word-wrap: break-word; line-height: 18px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; font-family: 'Courier New', 'DejaVu Sans Mono', Tahoma, Verdana, Segoe, sans-serif; color: #000000; background-color: #f9f9f9; border-left-width: 3px; border-left-style: solid; border-left-color: #e0e0e0; border-top-width: 1px; border-top-style: solid; border-top-color: #e0e0e0; border-right-width: 1px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&#xD;
&amp;lt;log4net&amp;gt;&#xD;
    &amp;lt;appender name="Console" type="log4net.Appender.ConsoleAppender"&amp;gt;&#xD;
    &amp;lt;/appender&amp;gt;&#xD;
&#xD;
    &amp;lt;appender name="RollingFile" type="log4net.Appender.RollingFileAppender"&amp;gt;&#xD;
    &amp;lt;/appender&amp;gt;&#xD;
&#xD;
    &amp;lt;root&amp;gt;&#xD;
        &amp;lt;level value="DEBUG" /&amp;gt;&#xD;
        &amp;lt;appender-ref ref="Console" /&amp;gt;&#xD;
        &amp;lt;appender-ref ref="RollingFile" /&amp;gt;&#xD;
    &amp;lt;/root&amp;gt;&#xD;
&amp;lt;/log4net&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;2. Appender / Layout&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Log4net 提供了大量的 Appender，最常用的包括 AdoNetAppender、AspNetTraceAppender、ConsoleAppender、FileAppender、OutputDebugStringAppender。每种 Appender 都有特定一些参数，使用时直接从 《Log4net 手册》的示例中拷贝过去，就OK了。(代码摘自 Log4net 手册)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;(1) AspNetTraceAppender&lt;/strong&gt;&lt;br /&gt;&lt;pre  style="white-space: pre-wrap; word-wrap: break-word; line-height: 18px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; font-family: 'Courier New', 'DejaVu Sans Mono', Tahoma, Verdana, Segoe, sans-serif; color: #000000; background-color: #f9f9f9; border-left-width: 3px; border-left-style: solid; border-left-color: #e0e0e0; border-top-width: 1px; border-top-style: solid; border-top-color: #e0e0e0; border-right-width: 1px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;&amp;lt;appender name="AspNetTraceAppender" type="log4net.Appender.AspNetTraceAppender" &amp;gt;&#xD;
    &amp;lt;layout type="log4net.Layout.PatternLayout"&amp;gt;&#xD;
        &amp;lt;conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" /&amp;gt;&#xD;
    &amp;lt;/layout&amp;gt;&#xD;
&amp;lt;/appender&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;(2) ConsoleAppender&lt;/strong&gt;&lt;br /&gt;&lt;pre  style="white-space: pre-wrap; word-wrap: break-word; line-height: 18px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; font-family: 'Courier New', 'DejaVu Sans Mono', Tahoma, Verdana, Segoe, sans-serif; color: #000000; background-color: #f9f9f9; border-left-width: 3px; border-left-style: solid; border-left-color: #e0e0e0; border-top-width: 1px; border-top-style: solid; border-top-color: #e0e0e0; border-right-width: 1px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;&amp;lt;appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender"&amp;gt;&#xD;
    &amp;lt;layout type="log4net.Layout.PatternLayout"&amp;gt;&#xD;
        &amp;lt;conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" /&amp;gt;&#xD;
    &amp;lt;/layout&amp;gt;&#xD;
&amp;lt;/appender&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;(3) OutputDebugStringAppender&lt;/strong&gt;&lt;br /&gt;&lt;pre  style="white-space: pre-wrap; word-wrap: break-word; line-height: 18px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; font-family: 'Courier New', 'DejaVu Sans Mono', Tahoma, Verdana, Segoe, sans-serif; color: #000000; background-color: #f9f9f9; border-left-width: 3px; border-left-style: solid; border-left-color: #e0e0e0; border-top-width: 1px; border-top-style: solid; border-top-color: #e0e0e0; border-right-width: 1px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;&amp;lt;appender name="OutputDebugStringAppender" type="log4net.Appender.OutputDebugStringAppender" &amp;gt;&#xD;
    &amp;lt;layout type="log4net.Layout.PatternLayout"&amp;gt;&#xD;
        &amp;lt;conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" /&amp;gt;&#xD;
    &amp;lt;/layout&amp;gt;&#xD;
&amp;lt;/appender&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;(4) FileAppender&lt;/strong&gt;&lt;br /&gt;&lt;pre  style="white-space: pre-wrap; word-wrap: break-word; line-height: 18px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; font-family: 'Courier New', 'DejaVu Sans Mono', Tahoma, Verdana, Segoe, sans-serif; color: #000000; background-color: #f9f9f9; border-left-width: 3px; border-left-style: solid; border-left-color: #e0e0e0; border-top-width: 1px; border-top-style: solid; border-top-color: #e0e0e0; border-right-width: 1px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;&amp;lt;appender name="FileAppender" type="log4net.Appender.FileAppender"&amp;gt;&#xD;
    &amp;lt;file value="log-file.txt" /&amp;gt;&#xD;
    &amp;lt;appendToFile value="true" /&amp;gt;&#xD;
    &amp;lt;layout type="log4net.Layout.PatternLayout"&amp;gt;&#xD;
        &amp;lt;conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" /&amp;gt;&#xD;
    &amp;lt;/layout&amp;gt;&#xD;
&amp;lt;/appender&amp;gt;&lt;/pre&gt;&lt;br /&gt;有关 Layout 详细信息，请参考 Log4net 相关文档，本文不做详述。&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Configuration&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Log4net 的配置方式十分灵活，即可以写到应用程序配置文件中，也可以使用独立配置文件。同时它还提供了监测配置文件变化的功能，这样我们随时可以调整配置，而无须重启应用程序。&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;(1) 使用 app.config / web.config&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;app.config / web.config&lt;pre  style="white-space: pre-wrap; word-wrap: break-word; line-height: 18px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; font-family: 'Courier New', 'DejaVu Sans Mono', Tahoma, Verdana, Segoe, sans-serif; color: #000000; background-color: #f9f9f9; border-left-width: 3px; border-left-style: solid; border-left-color: #e0e0e0; border-top-width: 1px; border-top-style: solid; border-top-color: #e0e0e0; border-right-width: 1px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&#xD;
&amp;lt;configuration&amp;gt;&#xD;
    &amp;lt;configSections&amp;gt;&#xD;
        &amp;lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /&amp;gt;&#xD;
    &amp;lt;/configSections&amp;gt;&#xD;
&#xD;
    &amp;lt;log4net&amp;gt;&#xD;
        &amp;lt;appender name="Console" type="log4net.Appender.ConsoleAppender"&amp;gt;&#xD;
            &amp;lt;layout type="log4net.Layout.PatternLayout"&amp;gt;&#xD;
                &amp;lt;conversionPattern value="%5level [%thread] (%file:%line) - %message%newline" /&amp;gt;&#xD;
            &amp;lt;/layout&amp;gt;&#xD;
        &amp;lt;/appender&amp;gt;&#xD;
&#xD;
        &amp;lt;root&amp;gt;&#xD;
            &amp;lt;level value="DEBUG" /&amp;gt;&#xD;
            &amp;lt;appender-ref ref="Console" /&amp;gt;&#xD;
        &amp;lt;/root&amp;gt;&#xD;
    &amp;lt;/log4net&amp;gt;&#xD;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;&lt;br /&gt;使用代码初始化配置。&lt;pre  style="white-space: pre-wrap; word-wrap: break-word; line-height: 18px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; font-family: 'Courier New', 'DejaVu Sans Mono', Tahoma, Verdana, Segoe, sans-serif; color: #000000; background-color: #f9f9f9; border-left-width: 3px; border-left-style: solid; border-left-color: #e0e0e0; border-top-width: 1px; border-top-style: solid; border-top-color: #e0e0e0; border-right-width: 1px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;log4net.Config.XmlConfigurator.Configure();&lt;/pre&gt;&lt;br /&gt;&lt;strong&gt;(2) 使用自定义配置文件&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;test.log4net&lt;pre  style="white-space: pre-wrap; word-wrap: break-word; line-height: 18px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; font-family: 'Courier New', 'DejaVu Sans Mono', Tahoma, Verdana, Segoe, sans-serif; color: #000000; background-color: #f9f9f9; border-left-width: 3px; border-left-style: solid; border-left-color: #e0e0e0; border-top-width: 1px; border-top-style: solid; border-top-color: #e0e0e0; border-right-width: 1px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt; &#xD;
&amp;lt;log4net&amp;gt;&#xD;
    &amp;lt;appender name="Console" type="log4net.Appender.ConsoleAppender"&amp;gt;&#xD;
        &amp;lt;layout type="log4net.Layout.PatternLayout"&amp;gt;&#xD;
            &amp;lt;conversionPattern value="%5level [%thread] (%file:%line) - %message%newline" /&amp;gt;&#xD;
        &amp;lt;/layout&amp;gt;&#xD;
    &amp;lt;/appender&amp;gt;&#xD;
    &#xD;
    &amp;lt;root&amp;gt;&#xD;
        &amp;lt;level value="DEBUG" /&amp;gt;&#xD;
        &amp;lt;appender-ref ref="Console" /&amp;gt;&#xD;
    &amp;lt;/root&amp;gt;&#xD;
&amp;lt;/log4net&amp;gt;&lt;/pre&gt;&lt;br /&gt;使用代码初始化配置。&lt;pre  style="white-space: pre-wrap; word-wrap: break-word; line-height: 18px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; font-family: 'Courier New', 'DejaVu Sans Mono', Tahoma, Verdana, Segoe, sans-serif; color: #000000; background-color: #f9f9f9; border-left-width: 3px; border-left-style: solid; border-left-color: #e0e0e0; border-top-width: 1px; border-top-style: solid; border-top-color: #e0e0e0; border-right-width: 1px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;log4net.Config.XmlConfigurator.Configure(new FileInfo("test.log4net"));&lt;/pre&gt;&lt;br /&gt;使用 XmlConfigurator.ConfigureAndWatch() 方法除了初始化配置外，还会监测配置文件的变化，一旦发生修改，将自动刷新配置。&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;(3) XmlConfiguratorAttribute&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;我们还可以使用 XmlConfiguratorAttribute 代替 XmlConfigurator.Config()/ConfigureAndWatch()，ConfiguratorAttribute 用于定义与 Assembly 相关联的配置文件名。&lt;br /&gt;&lt;br /&gt;方式1: 关联到 test.log4net，并监测变化。&lt;pre  style="white-space: pre-wrap; word-wrap: break-word; line-height: 18px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; font-family: 'Courier New', 'DejaVu Sans Mono', Tahoma, Verdana, Segoe, sans-serif; color: #000000; background-color: #f9f9f9; border-left-width: 3px; border-left-style: solid; border-left-color: #e0e0e0; border-top-width: 1px; border-top-style: solid; border-top-color: #e0e0e0; border-right-width: 1px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;[assembly: log4net.Config.XmlConfigurator(ConfigFile="test.log4net", Watch=true)]&lt;/pre&gt;&lt;br /&gt;方式2: 关联到 test.exe.log4net (或 test.dll.log4net，文件名前缀为当前程序集名称)，并监测变化。&lt;pre  style="white-space: pre-wrap; word-wrap: break-word; line-height: 18px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; font-family: 'Courier New', 'DejaVu Sans Mono', Tahoma, Verdana, Segoe, sans-serif; color: #000000; background-color: #f9f9f9; border-left-width: 3px; border-left-style: solid; border-left-color: #e0e0e0; border-top-width: 1px; border-top-style: solid; border-top-color: #e0e0e0; border-right-width: 1px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;[assembly: log4net.Config.XmlConfigurator(ConfigFileExtension="log4net", Watch=true)]&lt;/pre&gt;&lt;div  style="margin-top: 20px; color: #999999; font-size: 11px; "&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;img src="http://www.cnblogs.com/shawnliu/aggbug/1799362.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shawnliu/archive/2010/08/13/1799362.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/shawnliu/archive/2010/08/13/1799357.html</id><title type="text">浅谈大型网站动态应用系统架构</title><summary type="text">动态应用，是相对于网站静态内容而言，是指以c/c++、php、Java、perl、.net等服务器端语言开发的网络应用软件，比如论坛、网络相册、交友、BLOG等常见应用。动态应用系统通常与数据库系统、缓存系统、分布式存储系统等密不可分。　　大型动态应用系统平台主要是针对于大流量、高并发网站建立的底层系统架构。大型网站的运行需要一个可靠、安全、可扩展、易维护的应用系统平台做为支撑，以保证网站应用的平...</summary><published>2010-08-13T14:53:00Z</published><updated>2010-08-13T14:53:00Z</updated><author><name>shawnliu</name><uri>http://www.cnblogs.com/shawnliu/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shawnliu/archive/2010/08/13/1799357.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shawnliu/archive/2010/08/13/1799357.html"/><content type="html">&lt;span  style="color: #404040; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 25px; "&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;动态应用，是相对于网站静态内容而言，是指以c/c++、php、Java、perl、.net等服务器端语言开发的网络应用软件，比如论坛、网络相册、交友、BLOG等常见应用。动态应用系统通常与数据库系统、缓存系统、分布式存储系统等密不可分。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;大型动态应用系统平台主要是针对于大流量、高并发网站建立的底层系统架构。大型网站的运行需要一个可靠、安全、可扩展、易维护的应用系统平台做为支撑，以保证网站应用的平稳运行。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;大型动态应用系统又可分为几个子系统：&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;1）Web前端系统&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;2）负载均衡系统&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;3）数据库集群系统&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;4）缓存系统&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;5）分布式存储系统&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;6）分布式服务器管理系统&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;7）代码分发系统&lt;/p&gt;&lt;h3 style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #494949; font-size: 14px; line-height: 25px; "&gt;　　Web前端系统&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;结构图：&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; text-align: center; "&gt;&lt;img src="http://pic001.cnblogs.com/img/dudu/201008/2010080710135176.jpg" alt="" width="620" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #494949; font-size: 14px; line-height: 1.5em; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;为了达到不同应用的服务器共享、避免单点故障、集中管理、统一配置等目的，不以应用划分服务器，而是将所有服务器做统一使用，每台服务器都可以对多个应用提供服务，当某些应用访问量升高时，通过增加服务器节点达到整个服务器集群的性能提高，同时使他应用也会受益。该Web前端系统基于Apache/Lighttpd/Eginx等的虚拟主机平台，提供PHP程序运行环境。服务器对开发人员是透明的，不需要开发人员介入服务器管理&lt;/p&gt;&lt;h3 style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #494949; font-size: 14px; line-height: 25px; "&gt;　　负载均衡系统&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; text-align: center; "&gt;&lt;img src="http://pic001.cnblogs.com/img/dudu/201008/2010080710160218.jpg" alt="" width="620" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #494949; font-size: 14px; line-height: 1.5em; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;负载均衡系统分为硬件和软件两种。硬件负载均衡效率高，但是价格贵，比如F5等。软件负载均衡系统价格较低或者免费，效率较硬件负载均衡系统低，不过对于流量一般或稍大些网站来讲也足够使用，比如lvs, nginx。大多数网站都是硬件、软件负载均衡系统并用。&lt;/p&gt;&lt;h3 style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #494949; font-size: 14px; line-height: 25px; "&gt;　　数据库集群系统&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;结构图：&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; text-align: center; "&gt;&lt;img src="http://pic001.cnblogs.com/img/dudu/201008/2010080710173056.jpg" alt="" width="620" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #494949; font-size: 14px; line-height: 1.5em; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;由于Web前端采用了负载均衡集群结构提高了服务的有效性和扩展性，因此数据库必须也是高可靠的，才能保证整个服务体系的高可靠性，如何构建一个高可靠的、可以提供大规模并发处理的数据库体系？&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;我们可以采用如上图所示的方案：&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;1) 使用 MySQL 数据库，考虑到Web应用的数据库读多写少的特点，我们主要对读数据库做了优化，提供专用的读数据库和写数据库，在应用程序中实现读操作和写操作分别访问不同的数据库。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;2) 使用 MySQL Replication 机制实现快速将主库（写库）的数据库复制到从库（读库）。一个主库对应多个从库，主库数据实时同步到从库。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;3) 写数据库有多台，每台都可以提供多个应用共同使用，这样可以解决写库的性能瓶颈问题和单点故障问题。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;4) 读数据库有多台，通过负载均衡设备实现负载均衡，从而达到读数据库的高性能、高可靠和高可扩展性。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;5) 数据库服务器和应用服务器分离。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;6) 从数据库使用BigIP做负载均衡。&lt;/p&gt;&lt;h3 style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #494949; font-size: 14px; line-height: 25px; "&gt;　　缓存系统&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; text-align: center; "&gt;&lt;img src="http://pic001.cnblogs.com/img/dudu/201008/2010080710201550.jpg" alt="" width="620" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #494949; font-size: 14px; line-height: 1.5em; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;缓存分为文件缓存、内存缓存、数据库缓存。在大型Web应用中使用最多且效率最高的是内存缓存。最常用的内存缓存工具是Memcached。使用正确的缓存系统可以达到实现以下目标：&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;1、使用缓存系统可以提高访问效率，提高服务器吞吐能力，改善用户体验。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;2、减轻对数据库及存储集服务器的访问压力。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;3、Memcached服务器有多台，避免单点故障，提供高可靠性和可扩展性，提高性能。&lt;/p&gt;&lt;h3 style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #494949; font-size: 14px; line-height: 25px; "&gt;　　分布式存储系统&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;结构图：&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; text-align: center; "&gt;&lt;img src="http://pic001.cnblogs.com/img/dudu/201008/2010080710221241.jpg" alt="" width="620" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #494949; font-size: 14px; line-height: 1.5em; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;Web系统平台中的存储需求有下面两个特点：&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;1) 存储量很大，经常会达到单台服务器无法提供的规模，比如相册、视频等应用。因此需要专业的大规模存储系统。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;2) 负载均衡cluster中的每个节点都有可能访问任何一个数据对象，每个节点对数据的处理也能被其他节点共享，因此这些节点要操作的数据从逻辑上看只能是一个整体，不是各自独立的数据资源。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;因此高性能的分布式存储系统对于大型网站应用来说是非常重要的一环。（这个地方需要加入对某个分布式存储系统的简单介绍。）&lt;/p&gt;&lt;h3 style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #494949; font-size: 14px; line-height: 25px; "&gt;　　分布式服务器管理系统&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;结构图：&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; text-align: center; "&gt;&lt;img src="http://pic001.cnblogs.com/img/dudu/201008/2010080710244598.jpg" alt="" width="620" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #494949; font-size: 14px; line-height: 1.5em; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;随着网站访问流量的不断增加，大多的网络服务都是以负载均衡集群的方式对外提供服务，随之集群规模的扩大，原来基于单机的服务器管理模式已经不能够满足我们的需求，新的需求必须能够集中式的、分组的、批量的、自动化的对服务器进行管理，能够批量化的执行计划任务。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;在分布式服务器管理系统软件中有一些比较优秀的软件，其中比较理想的一个是Cfengine。它可以对服务器进行分组，不同的分组可以分别定制系统配置文件、计划任务等配置。它是基于C/S 结构的，所有的服务器配置和管理脚本程序都保存在Cfengine Server上，而被管理的服务器运行着 Cfengine Client 程序，Cfengine Client通过SSL加密的连接定期的向服务器端发送请求以获取最新的配置文件和管理命令、脚本程序、补丁安装等任务。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;有了Cfengine这种集中式的服务器管理工具，我们就可以高效的实现大规模的服务器集群管理，被管理服务器和 Cfengine Server 可以分布在任何位置，只要网络可以连通就能实现快速自动化的管理。&lt;/p&gt;&lt;h3 style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #494949; font-size: 14px; line-height: 25px; "&gt;　　代码发布系统&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;结构图：&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; text-align: center; "&gt;&lt;img src="http://pic001.cnblogs.com/img/dudu/201008/2010080710262459.jpg" alt="" width="620" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #494949; font-size: 14px; line-height: 1.5em; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;随着网站访问流量的不断增加，大多的网络服务都是以负载均衡集群的方式对外提供服务，随之集群规模的扩大，为了满足集群环境下程序代码的批量分发和更新，我们还需要一个程序代码发布系统。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;这个发布系统可以帮我们实现下面的目标：&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;1) 生产环境的服务器以虚拟主机方式提供服务，不需要开发人员介入维护和直接操作，提供发布系统可以实现不需要登陆服务器就能把程序分发到目标服务器。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;2) 我们要实现内部开发、内部测试、生产环境测试、生产环境发布的4个开发阶段的管理，发布系统可以介入各个阶段的代码发布。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;3) 我们需要实现源代码管理和版本控制，SVN可以实现该需求。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #404040; font-size: 14px; line-height: 25px; "&gt;这里面可以使用常用的工具Rsync，通过开发相应的脚本工具实现服务器集群间代码同步分发。&lt;/p&gt;&lt;/span&gt;&lt;img src="http://www.cnblogs.com/shawnliu/aggbug/1799357.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shawnliu/archive/2010/08/13/1799357.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/shawnliu/archive/2010/08/13/1799355.html</id><title type="text">使用cfengine来实现服务器的自动化配置</title><summary type="text">p.s. cfengine的作用我感觉好像和powershell很像，两个都没玩过，不做点评，做个trackcfengine是一个功能强大的自动化系统管理工具.引用其官网的说法"cfengine是一种 UNIX 管理工具，其目的是使简单的管理的任务自动化，使困难的任务变得较容易。它的目标是使系统从任何状态收敛到一种理想状态。依照它的作者 Mark Burgess 所说，cfengine 总是使您的...</summary><published>2010-08-13T14:48:00Z</published><updated>2010-08-13T14:48:00Z</updated><author><name>shawnliu</name><uri>http://www.cnblogs.com/shawnliu/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shawnliu/archive/2010/08/13/1799355.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shawnliu/archive/2010/08/13/1799355.html"/><content type="html">&lt;span  style="font-family: 宋体; line-height: 26px; "&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; text-indent: 28px; "&gt;p.s. cfengine的作用我感觉好像和powershell很像，两个都没玩过，不做点评，做个track&amp;nbsp;&lt;/p&gt;&lt;p&gt;cfengine是一个功能强大的自动化系统管理工具.引用其官网的说法"cfengine是一种 UNIX 管理工具，其目的是使简单的管理的任务自动化，使困难的任务变得较容易。它的目标是使系统从任何状态收敛到一种理想状态。依照它的作者 Mark Burgess 所说，cfengine 总是使您的系统更接近于您所定义的配置； 它决不会使系统变得更糟。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; text-indent: 28px; "&gt;&amp;#8220;确实十分的拗口，也难以理解.简单的跟大家说说我的理解，很简单，就是你想你的系统应该是十分样子，你就可以使用cfengine来实现，它可以保证你的系统总是维持你所希望的那个状态。也就是说有黑客进来了修改了某个重要的配置文件的内容或者权限,也会被cfengine自动修复！&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; text-indent: 28px; "&gt;还有一种经常遇到的情况,有少则几台多则成千上万台机器,现在需要临时的改变其一个配置,例如删掉某个帐号,停掉某个服务,一般我们只能不厌其烦的登到每一台机器上重复的完成这些动作,但是有了cfengine,一个命令就可以搞定了.是不是很诱人?&lt;/p&gt;&lt;p&gt;&lt;a href="http://os.51cto.com/art/200711/60043.htm"&gt;http://os.51cto.com/art/200711/60043.htm&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;/span&gt;&lt;img src="http://www.cnblogs.com/shawnliu/aggbug/1799355.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shawnliu/archive/2010/08/13/1799355.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/shawnliu/archive/2010/07/08/1774010.html</id><title type="text">CodeDOM &amp;amp; Emit &amp;amp; MSIL</title><summary type="text">最近打算写点这方面的总结</summary><published>2010-07-08T15:11:00Z</published><updated>2010-07-08T15:11:00Z</updated><author><name>shawnliu</name><uri>http://www.cnblogs.com/shawnliu/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shawnliu/archive/2010/07/08/1774010.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shawnliu/archive/2010/07/08/1774010.html"/><content type="html">&lt;p&gt;最近打算写点这方面的总结&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/shawnliu/aggbug/1774010.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shawnliu/archive/2010/07/08/1774010.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/shawnliu/archive/2010/06/12/1756752.html</id><title type="text">如何在.NET中实现脚本引擎 (CodeDom篇)</title><summary type="text">.NET 本身提供了强大的脚本引擎，可以直接使用.NET CLR的任何编程语言作为脚本语言，如VB.NET、C#、JScript, J#等等。使用脚本引擎，我们可以动态生成任意表达式、或动态导入任意脚本文件，并在任意时候执行。 经实践发现，我们可以使用至少两种不同的方式在.NET中使用脚本引擎：VsaEngine和CodeDom。 其实，CodeDom不能算是真正的脚本引擎，它实际上是编译器。但是...</summary><published>2010-06-11T16:56:00Z</published><updated>2010-06-11T16:56:00Z</updated><author><name>shawnliu</name><uri>http://www.cnblogs.com/shawnliu/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shawnliu/archive/2010/06/12/1756752.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shawnliu/archive/2010/06/12/1756752.html"/><content type="html">&lt;span  style="font-family: 宋体, Verdana; line-height: 22px; color: #666666; "&gt;&lt;p style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;.NET 本身提供了强大的脚本引擎，可以直接使用.NET CLR的任何编程语言作为脚本语言，如VB.NET、C#、JScript, J#等等。使用脚本引擎，我们可以动态生成任意表达式、或动态导入任意脚本文件，并在任意时候执行。&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 经实践发现，我们可以使用至少两种不同的方式在.NET中使用脚本引擎：VsaEngine和CodeDom。&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 其实，CodeDom不能算是真正的脚本引擎，它实际上是编译器。但是我们完全可以利用CodeDom来模拟脚本引擎。&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 使用Emit方法也能达到动态生成可执行代码的目的，而且Emit生成的代码不需要编译，因此速度更快。但是Emit插入的实际上是汇编代码，不能算是脚本语言。&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 本文介绍如何以CodeDom方式来动态生成可执行代码。&lt;/p&gt;&lt;p style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;（Teeta无法发布完整的文章，有兴趣查看整篇文章，请到：&lt;a href="http://ly4cn.cnblogs.com/archive/2005/11/03/267989.html" target="_blank" style="text-decoration: underline; color: #006699; "&gt;http://ly4cn.cnblogs.com/archive/2005/11/03/267989.html&lt;/a&gt;）&lt;/p&gt;&lt;p style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 构造一个编译器&lt;/p&gt;&lt;ul style="margin-top: 20px; margin-right: 20px; margin-bottom: 20px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "&gt;&lt;li style="width: 512px; white-space: nowrap; text-overflow: ellipsis; list-style-type: square; "&gt;设置编译参数&amp;nbsp;&lt;br /&gt;编译参数需要在CompilerParameters设置：&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;blockquote dir="ltr" style="margin-right: 0px; "&gt;&lt;p style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;/p&gt;&lt;table cellspacing="0" cellpadding="3" border="1" style="width: 594px; border-collapse: collapse; height: 192px; "&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;CompilerOptions&lt;/td&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;用于设置编译器命令行参数&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;IncludeDebugInformation&lt;/td&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;用于指示是否在内存在生成Assembly&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;GenerateInMemory&lt;/td&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;用于指示是否在内存在生成Assembly&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;GenerateExecutable&lt;/td&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;用于指示生成的Assembly类型是exe还是dll&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;OutputAssembly&lt;/td&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;用于指示生成的程序文件名（仅在GenerateInMemory为false的情况）&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;ReferencedAssemblies&lt;/td&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;用于添加引用Assembly&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;/p&gt;&lt;p style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;例如：&lt;/p&gt;&lt;div style="font-family: 宋体, Verdana; line-height: 20px; font-weight: normal; font-style: normal; padding-top: 4px; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-color: #cccccc; border-right-width: 1px; border-right-style: solid; border-top-color: #cccccc; border-top-width: 1px; border-top-style: solid; font-size: 13px; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; width: 511px; word-break: break-all; border-bottom-color: #cccccc; border-bottom-width: 1px; border-bottom-style: solid; background-color: #eeeeee; "&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/None.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;span style="color: #000000; "&gt;theParameters.ReferencedAssemblies.Add(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;System.dll&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;);&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/None.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;ul dir="ltr" style="margin-top: 20px; margin-right: 20px; margin-bottom: 20px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "&gt;&lt;li style="width: 512px; white-space: nowrap; text-overflow: ellipsis; list-style-type: square; "&gt;创建指定语言的编译器&amp;nbsp;&lt;br /&gt;编译需要由指定语言的CodeDomProvider生成。&lt;/li&gt;&lt;/ul&gt;&lt;blockquote dir="ltr" style="margin-right: 0px; "&gt;&lt;p dir="ltr" style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;这里列举一些.NET的CodeDomProvider：&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p dir="ltr" style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;/p&gt;&lt;table cellspacing="0" cellpadding="3" border="1" style="width: 540px; border-collapse: collapse; height: 84px; "&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;vb.net&amp;nbsp;&lt;/td&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;Microsoft.VisualBasic.VBCodeProvider&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;C#&lt;/td&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;Microsoft.CSharp.CSharpCodeProvider&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;jscript&lt;/td&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;Microsoft.JScript.JScriptCodeProvider&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;J#&lt;/td&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;Microsoft.VJSharp.VJSharpCodeProvider&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote style='border:2px solid #EFEFEF;color:#333333;padding:5px 10px;'&gt;&lt;p dir="ltr" style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;以C#为例，要创建C#编译器，代码如下：&amp;nbsp;&lt;/p&gt;&lt;div style="font-family: 宋体, Verdana; line-height: 20px; font-weight: normal; font-style: normal; padding-top: 4px; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-color: #cccccc; border-right-width: 1px; border-right-style: solid; border-top-color: #cccccc; border-top-width: 1px; border-top-style: solid; font-size: 13px; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; width: 472px; word-break: break-all; border-bottom-color: #cccccc; border-bottom-width: 1px; border-bottom-style: solid; background-color: #eeeeee; "&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/None.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;span style="color: #000000; "&gt;ICodeCompiler&amp;nbsp;compiler&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;Microsoft.CSharp.CSharpCodeProvider().CreateCompiler();&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote dir="ltr" style="margin-right: 0px; "&gt;&lt;p style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;下面是完整的创建编译器的例子：&lt;/p&gt;&lt;p style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;/p&gt;&lt;div style="font-family: 宋体, Verdana; line-height: 20px; font-weight: normal; font-style: normal; padding-top: 4px; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-color: #cccccc; border-right-width: 1px; border-right-style: solid; border-top-color: #cccccc; border-top-width: 1px; border-top-style: solid; font-size: 13px; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; width: 511px; word-break: break-all; border-bottom-color: #cccccc; border-bottom-width: 1px; border-bottom-style: solid; background-color: #eeeeee; "&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span id="Codehighlighter1_2_51_Open_Text"&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;创建相应脚本语言的编译器&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/None.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;private&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;void&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;createCompiler(&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;string&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;strLanguage,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;bool&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;debugMode,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;string&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;strAssemblyFileName)&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span id="Codehighlighter1_148_2224_Open_Text"&gt;&lt;span style="color: #000000; "&gt;{&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theParameters&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;CompilerParameters();&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theParameters.OutputAssembly&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;System.IO.Path.Combine(System.IO.Path.GetTempPath(),&amp;nbsp;strAssemblyFileName&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;+&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;.dll&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;);&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theParameters.GenerateExecutable&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;false&lt;/span&gt;&lt;span style="color: #000000; "&gt;;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theParameters.GenerateInMemory&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;true&lt;/span&gt;&lt;span style="color: #000000; "&gt;;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;if&lt;/span&gt;&lt;span style="color: #000000; "&gt;(debugMode)&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span id="Codehighlighter1_440_578_Open_Text"&gt;&lt;span style="color: #000000; "&gt;{&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theParameters.IncludeDebugInformation&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;true&lt;/span&gt;&lt;span style="color: #000000; "&gt;;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theParameters.CompilerOptions&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;+=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;/define:TRACE=1&amp;nbsp;/define:DEBUG=1&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;else&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span id="Codehighlighter1_591_714_Open_Text"&gt;&lt;span style="color: #000000; "&gt;{&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theParameters.IncludeDebugInformation&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;false&lt;/span&gt;&lt;span style="color: #000000; "&gt;;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theParameters.CompilerOptions&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;+=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;/define:TRACE=1&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AddReference(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;System.dll&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;);&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AddReference(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;System.Data.dll&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;);&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AddReference(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;System.Xml.dll&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;);&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;strLanguage&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;strLanguage.ToLower();&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CodeDomProvider&amp;nbsp;theProvider;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;if&lt;/span&gt;&lt;span style="color: #000000; "&gt;(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;visualbasic&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;==&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;strLanguage&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;||&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;vb&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;==&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;strLanguage)&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span id="Codehighlighter1_956_1470_Open_Text"&gt;&lt;span style="color: #000000; "&gt;{&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;theProvider&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;Microsoft.VisualBasic.VBCodeProvider();&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;if&lt;/span&gt;&lt;span style="color: #000000; "&gt;(debugMode)&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;theParameters.CompilerOptions&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;+=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;/debug:full&amp;nbsp;/optimize-&amp;nbsp;/optionexplicit+&amp;nbsp;/optionstrict+&amp;nbsp;/optioncompare:text&amp;nbsp;/imports:Microsoft.VisualBasic,System,System.Collections,System.Diagnostics&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;else&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;theParameters.CompilerOptions&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;+=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;/optimize&amp;nbsp;/optionexplicit+&amp;nbsp;/optionstrict+&amp;nbsp;/optioncompare:text&amp;nbsp;/imports:Microsoft.VisualBasic,System,System.Collections,System.Diagnostics&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AddReference(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;Microsoft.VisualBasic.dll&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;);&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;else&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;if&lt;/span&gt;&lt;span style="color: #000000; "&gt;(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;jscript&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;==&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;strLanguage&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;||&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;js&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;==&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;strLanguage)&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span id="Codehighlighter1_1535_1646_Open_Text"&gt;&lt;span style="color: #000000; "&gt;{&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;theProvider&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;Microsoft.JScript.JScriptCodeProvider();&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AddReference(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;Microsoft.JScript.dll&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;);&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;else&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;if&lt;/span&gt;&lt;span style="color: #000000; "&gt;(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;csharp&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;==&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;strLanguage&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;||&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;cs&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;==&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;strLanguage&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;||&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;c#&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;==&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;strLanguage)&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span id="Codehighlighter1_1733_1870_Open_Text"&gt;&lt;span style="color: #000000; "&gt;{&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;theProvider&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;Microsoft.CSharp.CSharpCodeProvider();&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;if&lt;/span&gt;&lt;span style="color: #000000; "&gt;(&lt;/span&gt;&lt;span style="color: #000000; "&gt;!&lt;/span&gt;&lt;span style="color: #000000; "&gt;debugMode)&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;theParameters.CompilerOptions&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;+=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;/optimize&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;//&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&amp;nbsp;if("jsharp"&amp;nbsp;==&amp;nbsp;strLanguage&amp;nbsp;||&amp;nbsp;"vj"&amp;nbsp;==&amp;nbsp;strLanguage&amp;nbsp;||&amp;nbsp;"j#"&amp;nbsp;==&amp;nbsp;strLanguage)&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;//&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;//&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;theProvider&amp;nbsp;=&amp;nbsp;new&amp;nbsp;Microsoft.VJSharp.VJSharpCodeProvider();&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;//&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(!debugMode)&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;//&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;theParameters.CompilerOptions&amp;nbsp;+=&amp;nbsp;"/optimize&amp;nbsp;";&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;//&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;else&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;throw&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;System.Exception(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;指定的脚本语言不被支持。&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;);&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theCompiler&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;theProvider.CreateCompiler();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/None.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span id="Codehighlighter1_2229_2326_Open_Text"&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;添加引用对象。&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&lt;param&amp;nbsp;name="__strassemblyname" /&gt;&lt;/param&amp;nbsp;name="__strassemblyname"&gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;引用的文件名&lt;/span&gt;&lt;span style="color: #808080; "&gt;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/None.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;public&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;void&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;AddReference(&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;string&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;__strAssemblyName)&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span id="Codehighlighter1_2382_2448_Open_Text"&gt;&lt;span style="color: #000000; "&gt;{&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;theParameters.ReferencedAssemblies.Add(__strAssemblyName);&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/None.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;br /&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 编译源代码&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 编译源代码相当简单，只需一条语句就搞定了：&lt;/p&gt;&lt;blockquote style='border:2px solid #EFEFEF;color:#333333;padding:5px 10px;'&gt;&lt;div style="font-family: 宋体, Verdana; line-height: 20px; font-weight: normal; font-style: normal; padding-top: 4px; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-color: #cccccc; border-right-width: 1px; border-right-style: solid; border-top-color: #cccccc; border-top-width: 1px; border-top-style: solid; font-size: 13px; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; width: 472px; word-break: break-all; border-bottom-color: #cccccc; border-bottom-width: 1px; border-bottom-style: solid; background-color: #eeeeee; "&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/None.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;span style="color: #000000; "&gt;CompilerResults&amp;nbsp;compilerResults&amp;nbsp;&amp;nbsp;＝&amp;nbsp;compiler.CompileAssemblyFromSource(&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theParameters,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.SourceText);&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote dir="ltr" style="margin-right: 0px; "&gt;&lt;p dir="ltr" style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;执行后，可以从compilerResults取得以下内容：&amp;nbsp;&lt;br /&gt;&lt;/p&gt;&lt;p dir="ltr" style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;/p&gt;&lt;table cellspacing="0" cellpadding="3" border="1" style="width: 566px; border-collapse: collapse; height: 79px; "&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;NativeCompilerReturnValue&lt;/td&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;编译结果，用于检查是否成功&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;Errors&lt;/td&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;编译时产生的错误和警告信息&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;CompiledAssembly&lt;/td&gt;&lt;td style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: top; "&gt;如果编译成功，则返回编译生成的Assembly&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;/p&gt;&lt;p dir="ltr" style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;br /&gt;示例函数：&amp;nbsp;&lt;/p&gt;&lt;div style="font-family: 宋体, Verdana; line-height: 20px; font-weight: normal; font-style: normal; padding-top: 4px; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-color: #cccccc; border-right-width: 1px; border-right-style: solid; border-top-color: #cccccc; border-top-width: 1px; border-top-style: solid; font-size: 13px; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; width: 511px; word-break: break-all; border-bottom-color: #cccccc; border-bottom-width: 1px; border-bottom-style: solid; background-color: #eeeeee; "&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span id="Codehighlighter1_2_137_Open_Text"&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;编译脚本。编译前将清空以前的编译信息。&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;CompilerInfo将包含编译时产生的错误信息。&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&lt;returns&gt;&lt;/returns&gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;成功时返回True。不成功为False。&lt;/span&gt;&lt;span style="color: #808080; "&gt;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/None.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;public&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;bool&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;Compile()&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span id="Codehighlighter1_164_845_Open_Text"&gt;&lt;span style="color: #000000; "&gt;{&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theCompilerInfo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;""&lt;/span&gt;&lt;span style="color: #000000; "&gt;;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.isCompiled&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;false&lt;/span&gt;&lt;span style="color: #000000; "&gt;;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theCompiledAssembly&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;null&lt;/span&gt;&lt;span style="color: #000000; "&gt;;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theCompilerResults&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theCompiler.CompileAssemblyFromSource(&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theParameters,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.SourceText);&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;if&lt;/span&gt;&lt;span style="color: #000000; "&gt;(&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theCompilerResults.NativeCompilerReturnValue&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;==&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;0&lt;/span&gt;&lt;span style="color: #000000; "&gt;)&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span id="Codehighlighter1_436_542_Open_Text"&gt;&lt;span style="color: #000000; "&gt;{&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.isCompiled&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;true&lt;/span&gt;&lt;span style="color: #000000; "&gt;;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theCompiledAssembly&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theCompilerResults.CompiledAssembly;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.Text.StringBuilder&amp;nbsp;compilerInfo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;new&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;System.Text.StringBuilder();&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;foreach&lt;/span&gt;&lt;span style="color: #000000; "&gt;(CompilerError&amp;nbsp;err&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;in&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;this&lt;/span&gt;&lt;span style="color: #000000; "&gt;.theCompilerResults.Errors)&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span id="Codehighlighter1_690_771_Open_Text"&gt;&lt;span style="color: #000000; "&gt;{&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;compilerInfo.Append(err.ToString());&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;compilerInfo.Append(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;\r\n&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;);&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;theCompilerInfo&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;=&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;compilerInfo.ToString();&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;return&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;isCompiled;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/None.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;p dir="ltr" style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 执行代码&amp;nbsp;&lt;br /&gt;&lt;/p&gt;&lt;blockquote dir="ltr" style="margin-right: 0px; "&gt;&lt;p dir="ltr" style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;使用Reflection机制就可以很方便的执行Assembly中的代码。&amp;nbsp;&lt;br /&gt;我们假设编译时使用的脚本代码 this.SourceText 内容如下：&lt;/p&gt;&lt;div style="font-family: 宋体, Verdana; line-height: 20px; font-weight: normal; font-style: normal; padding-top: 4px; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-color: #cccccc; border-right-width: 1px; border-right-style: solid; border-top-color: #cccccc; border-top-width: 1px; border-top-style: solid; font-size: 13px; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; width: 511px; word-break: break-all; border-bottom-color: #cccccc; border-bottom-width: 1px; border-bottom-style: solid; background-color: #eeeeee; "&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/None.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;span style="color: #0000ff; "&gt;namespace&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;test&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;/span&gt;&lt;span id="Codehighlighter1_16_118_Open_Text"&gt;&lt;span style="color: #000000; "&gt;{&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;public&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;class&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;script&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span id="Codehighlighter1_42_115_Open_Text"&gt;&lt;span style="color: #000000; "&gt;{&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;static&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;public&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;void&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;Main()&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span id="Codehighlighter1_76_111_Open_Text"&gt;&lt;span style="color: #000000; "&gt;{&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MessageBox.Show(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;Hello&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;);&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/None.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p dir="ltr" style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;则相应的执行代码为：&amp;nbsp;&lt;br /&gt;&lt;/p&gt;&lt;div style="font-family: 宋体, Verdana; line-height: 20px; font-weight: normal; font-style: normal; padding-top: 4px; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-color: #cccccc; border-right-width: 1px; border-right-style: solid; border-top-color: #cccccc; border-top-width: 1px; border-top-style: solid; font-size: 13px; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; width: 511px; word-break: break-all; border-bottom-color: #cccccc; border-bottom-width: 1px; border-bottom-style: solid; background-color: #eeeeee; "&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/None.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;span style="color: #000000; "&gt;scriptEngine.Invoke(&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;test.script&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;Main&lt;/span&gt;&lt;span style="color: #000000; "&gt;"&lt;/span&gt;&lt;span style="color: #000000; "&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;null&lt;/span&gt;&lt;span style="color: #000000; "&gt;);&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/None.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p dir="ltr" style="font-family: 宋体, Verdana; line-height: 22px; font-weight: normal; font-style: normal; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Invoke函数内容：&lt;/p&gt;&lt;div style="font-family: 宋体, Verdana; line-height: 20px; font-weight: normal; font-style: normal; padding-top: 4px; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-right-color: #cccccc; border-right-width: 1px; border-right-style: solid; border-top-color: #cccccc; border-top-width: 1px; border-top-style: solid; font-size: 13px; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; width: 511px; word-break: break-all; border-bottom-color: #cccccc; border-bottom-width: 1px; border-bottom-style: solid; background-color: #eeeeee; "&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span id="Codehighlighter1_2_310_Open_Text"&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;执行指定的脚本函数(Method)。&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;如果指定的类或模块名，以及函数(Method)、或参数不正确，将会产生VsaException/VshException例外。&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&amp;lt;param&amp;nbsp;name="__strModule"&amp;gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;类或模块名&lt;/span&gt;&lt;span style="color: #808080; "&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&amp;lt;param&amp;nbsp;name="__strMethod"&amp;gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;要执行的函数(Method)名字&lt;/span&gt;&lt;span style="color: #808080; "&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/InBlock.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&amp;lt;param&amp;nbsp;name="__Arguments"&amp;gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;参数(数组)&lt;/span&gt;&lt;span style="color: #808080; "&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;///&lt;/span&gt;&lt;span style="color: #008000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&amp;lt;returns&amp;gt;&lt;/span&gt;&lt;span style="color: #008000; "&gt;返回执行的结果&lt;/span&gt;&lt;span style="color: #808080; "&gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;span style="color: #808080; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;img src="http://ly4cn.cnblogs.com/Images/OutliningIndicators/None.gif" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; position: relative; opacity: 1; max-width: 560px; max-height: 560px; "  alt="" /&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;public&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;object&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;Invoke(&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;string&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;__strModule,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;string&lt;/span&gt;&lt;span style="color: #000000; "&gt;&amp;nbsp;__strMethod,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff; "&gt;object&lt;/span&gt;&lt;span style="color: #000000; "&gt;[]&amp;nbsp;__Arguments)&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;img src="http://www.cnblogs.com/shawnliu/aggbug/1756752.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shawnliu/archive/2010/06/12/1756752.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/shawnliu/archive/2010/06/10/1755921.html</id><title type="text">SQL Server中奇妙的NULL</title><summary type="text">http://www.cnblogs.com/changbluesky/archive/2010/05/07/1729519.htmlps.懒得写，懒得总结，copy一个总结不错的，不过还有一些没说到，总之，翻过几次错遇到null都要多考虑多测试相信大家在写SQL时都会有遇到NULL的经历吧,在一个table插入NULL,与NULL作比较等等.1.NULL意思为缺失的值(missing value...</summary><published>2010-06-10T14:22:00Z</published><updated>2010-06-10T14:22:00Z</updated><author><name>shawnliu</name><uri>http://www.cnblogs.com/shawnliu/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shawnliu/archive/2010/06/10/1755921.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shawnliu/archive/2010/06/10/1755921.html"/><content type="html">&lt;p&gt;&lt;span  style="font-family: georgia, verdana, Arial, helvetica, sans-seriff; line-height: 20px; font-size: 13px; color: #4b4b4b; "&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;a href="http://www.cnblogs.com/changbluesky/archive/2010/05/07/1729519.html" target="_blank"&gt;http://www.cnblogs.com/changbluesky/archive/2010/05/07/1729519.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;ps.懒得写，懒得总结，copy一个总结不错的，不过还有一些没说到，总之，翻过几次错遇到null都要多考虑多测试&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;相信大家在写SQL时都会有遇到NULL的经历吧,在一个table插入NULL,与NULL作比较等等.&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;1.NULL意思为缺失的值(missing value).&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;2.三值逻辑(three-valued-logic: TRUE,FALSE,UNKNOWN). 在SQL中有三个逻辑谓词:TURE,FALSE,UNKNOWN.在大多数的编程语言中只有TRUE和FALSE,而在SQL中独有UNKNOWN,之所有存在与NULL有关.&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;比如做如下比较:&amp;nbsp;NULL&amp;gt;32;NULL=NULL;X+NULL&amp;gt;Y;NULL&amp;lt;&amp;gt;NULL.其计算结果均为UNKNOWN.&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;可能会有些迷惑,于二值逻辑不同(NOT TURE=FALUSE;NOT FALSE=TRUE)的是NOT UNKNOWN=UNKNOWN.&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;3.UNKNOWN作为FALSE时的处理. 在SQL中查询过滤时(ON,WHERE,HAVING)会把UNKNOWN作为FALSE处理,这样就不会把计算值为UNKNOWN的行添加到下一个结果集中.&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;4.UNKNOWN作为TRUE时的处理. 在CHECK约束中UNKNOWN却作为TRUE来处理.&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;比如在一个table中添加约束条件,约束年龄必须大于零:alter table test1 add constraint ck_age&amp;nbsp;check (age&amp;gt;0),在插入数据时仍然可以插入NULL值(前提是这列没有定义NOT NULL约束).insert into test1(age) values(NULL)&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;div style="background-color: #F5F5F5;border: 1px solid #CCCCCC;padding-left:5px;padding-right:5px;" style="background-color: #f5f5f5; font-family: 'Courier New'; font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #cccccc; border-right-color: #cccccc; border-bottom-color: #cccccc; border-left-color: #cccccc; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; word-break: break-all; overflow-x: auto; overflow-y: auto; "&gt;&lt;span  style="line-height: 19px; border-right-color: #808080; border-right-width: 1px; border-right-style: solid; border-top-color: #808080; border-top-width: 1px; border-top-style: solid; border-left-color: #808080; border-left-width: 1px; border-left-style: solid; border-bottom-color: #808080; border-bottom-width: 1px; border-bottom-style: solid; background-color: #ffffff; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; font-family: 'Courier New'; "&gt;代码&lt;/span&gt;&lt;div  id="cnblogs_code_open_bf13ca63-98c6-48fa-9aab-1d978f69ebb3" style="display: block; "&gt;&lt;pre style="margin-top: 0px; margin-bottom: 0px; "&gt;&lt;div&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;create&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;table&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; test&lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;(&lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;Name &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;varchar&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;(&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #800000; font-weight: bold; "&gt;10&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;),&lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;age &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;int&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #008080; "&gt;--&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #008080; "&gt;add check constraint age&amp;gt;0&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #008080; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;alter&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;table&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; test &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;add&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;constraint&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; ck_age &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;check&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; (age&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #808080; "&gt;&amp;gt;&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #800000; font-weight: bold; "&gt;0&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;insert&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;into&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; test &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;values&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;(&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #ff0000; "&gt;'&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #ff0000; "&gt;bluesky&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #ff0000; "&gt;'&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;,&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;null&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;select&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #808080; "&gt;*&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;from&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; test&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;可以插入NULL值.&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;span  style="line-height: 19px; border-right-color: #808080; border-right-width: 1px; border-right-style: solid; border-top-color: #808080; border-top-width: 1px; border-top-style: solid; border-left-color: #808080; border-left-width: 1px; border-left-style: solid; border-bottom-color: #808080; border-bottom-width: 1px; border-bottom-style: solid; background-color: #ffffff; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; font-family: 'Courier New'; "&gt;代码&lt;/span&gt;&lt;div  id="cnblogs_code_open_5a7798ec-9fa6-4493-85eb-c44decdce24b" style="display: block; "&gt;&lt;pre style="margin-top: 0px; margin-bottom: 0px; "&gt;&lt;div&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #008080; "&gt;--&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #008080; "&gt;drop the unique constraint&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #008080; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;ALTER&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;TABLE&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #ff0000; "&gt;[&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #ff0000; "&gt;dbo&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #ff0000; "&gt;]&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;.&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #ff0000; "&gt;[&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #ff0000; "&gt;test&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #ff0000; "&gt;]&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;DROP&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;CONSTRAINT&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #ff0000; "&gt;[&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #ff0000; "&gt;UQ__test__737584F63A81B327&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #ff0000; "&gt;]&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #008080; "&gt;--&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #008080; "&gt;insert two null values&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #008080; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;insert&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;into&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; test &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;values&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;(&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;NULL&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;,&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #800000; font-weight: bold; "&gt;12&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;),&lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;(&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;NULL&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;,&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #800000; font-weight: bold; "&gt;13&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;select&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #808080; "&gt;*&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;from&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; test&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;select&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; Name,&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #ff00ff; "&gt;SUM&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt;(age)&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;as&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; sumage &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;from&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; test &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;group&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; &lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #0000ff; "&gt;by&lt;/span&gt;&lt;span style="line-height: 19px; font-family: 'Courier New'; color: #000000; "&gt; Name&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;可以看到NULL被分成了一组:&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;img src="http://pic002.cnblogs.com/img/chang99/201005/2010050711094521.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "  alt="" /&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;5.2 ORDER BY会把NULL排序在一起.&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;5.3 在集合操作时会把NULL当成等值的来处理.&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 0px; "&gt;总之: 识别在不同的情况下:NULL操作时被作为UNKNOWN还是作为TRUE,FALSE,有助于更好的写SQL及DB设计.&lt;/p&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/shawnliu/aggbug/1755921.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shawnliu/archive/2010/06/10/1755921.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/shawnliu/archive/2010/03/25/1696375.html</id><title type="text">什么是Landing Page?</title><summary type="text">Landing page也可以称为着陆页，网站上任何一个接受流量的网页都可以称为landing apge。与普通的网页不同，landing page需要完成不同的使命，它需要把访问者引导到他们需要的网页，landing page并不是目标页，而只是引导访问者到目标页的一个中间页面。如果你租过房子，你可能找过房屋中介，landing page就扮演中介的角色。房屋中介需要了解租房者的需求[搜索关键词...</summary><published>2010-03-25T15:26:00Z</published><updated>2010-03-25T15:26:00Z</updated><author><name>shawnliu</name><uri>http://www.cnblogs.com/shawnliu/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shawnliu/archive/2010/03/25/1696375.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shawnliu/archive/2010/03/25/1696375.html"/><content type="html">&lt;p&gt;Landing page也可以称为着陆页&amp;nbsp;，网站上任何一个接受流量的网页都可以称为landing apge。与普通的网页不同，landing page需要完成不同的使命，它需要把访问者引导到他们需要的网页，landing page并不是目标页，而只是引导访问者到目标页的一个中间页面。如果你租过房子，你可能找过房屋中介，landing page就扮演中介的角色。房屋中介需要了解租房者的需求[搜索关键词 -&amp;nbsp;Keywords]，并向租房者推荐适合的房子[房子信息也就是landing page的内容]，最后由你选择租赁哪个房东的房子[通过landing page到达目标页 -&amp;nbsp;mechants]&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;span  style="font-family: Arial, Tahoma, Verdana; font-size: 12px; line-height: 20px; color: #222222; "&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;下面是一些将landing page用在不同流量源的例子：&lt;/p&gt;&lt;ul style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; "&gt;&lt;li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;流量来自&lt;a title="pay per click" href="http://zhengyong.net/marketing/category/%e4%ba%92%e8%81%94%e7%bd%91%e8%90%a5%e9%94%80/pay-per-click" style="color: #115aa4; text-decoration: none; " target="_blank"&gt;pay per click&lt;/a&gt;&amp;nbsp;(PPC) 搜索引擎广告活动，比如&lt;a title="google" href="http://zhengyong.net/marketing/category/%e4%ba%92%e8%81%94%e7%bd%91%e6%96%b0%e9%97%bb/google-%e4%ba%92%e8%81%94%e7%bd%91%e6%96%b0%e9%97%bb" style="color: #115aa4; text-decoration: none; " target="_blank"&gt;google&lt;/a&gt;&amp;nbsp;&lt;a title="adwords" href="http://zhengyong.net/marketing/category/%e4%ba%92%e8%81%94%e7%bd%91%e8%90%a5%e9%94%80/adwords" style="color: #115aa4; text-decoration: none; " target="_blank"&gt;adwords&lt;/a&gt;或者yahoo search marketing，通过不同的搜索关键词进行优化了的多个landing page。&lt;/li&gt;&lt;li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;流量从banner广告或图片广告来到landing page，这类流量通常都来自指定的页面，并针对特定的目标客户。&lt;/li&gt;&lt;li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;为了推广一个特定的产品销售或引导，从电子邮件中的文本链接而来到landing page的流量。&lt;/li&gt;&lt;li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;为了预售一个affiliate产品或opt-in邮件订阅，从&lt;a title="blog" href="http://zhengyong.net/marketing/category/blog" style="color: #115aa4; text-decoration: none; " target="_blank"&gt;blog&lt;/a&gt;文章或sidebar而来到landing page的流量。&lt;/li&gt;&lt;li style="list-style-type: square; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 20px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;还有一种就是类似本文章的landing page，由一些专门围绕一个主题的相关页面链接组织起来的landing page，通过本网页你可以到达本网站任何一个与landing page相关的页面。&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Wikipedia的定义写的很好：&lt;/div&gt;&lt;span  style="color: #000000; font-family: sans-serif; font-size: 17px; line-height: 25px; "&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;In&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/Internet_marketing" title="Internet marketing" style="text-decoration: none; color: #002bb8; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: initial initial; " target="_blank"&gt;online marketing&lt;/a&gt;&amp;nbsp;a&amp;nbsp;&lt;strong&gt;landing page&lt;/strong&gt;, sometimes known as a&amp;nbsp;&lt;strong&gt;lead capture page&lt;/strong&gt;, is the page that appears when a potential customer clicks on an advertisement or a search-engine result link. The page will usually display content that is a logical extension of the advertisement or link, and that is optimized to feature specific keywords or phrases for indexing by search engines.&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;span  style="color: #000000; font-family: sans-serif; font-size: 17px; line-height: 25px; "&gt;In&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/Pay_per_click" title="Pay per click" style="text-decoration: none; color: #002bb8; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: initial initial; " target="_blank"&gt;pay per click (PPC)&lt;/a&gt;&amp;nbsp;campaigns, the landing page will also be customized to measure the effectiveness of different advertisements. By adding a parameter to the linking URL, marketers can measure advertisement effectiveness based on relative&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/Click-through_rate" title="Click-through rate" style="text-decoration: none; color: #002bb8; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; background-position: initial initial; " target="_blank"&gt;click-through rates&lt;/a&gt;.&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;国内也有一本中文Landing page书:&amp;nbsp;&lt;span  style="font-family: 宋体, Arial, Helvetica, sans-serif; font-size: 16px; line-height: 20px; font-weight: bold; "&gt;&lt;a href="http://click.linktech.cn/?m=dangdang&amp;amp;a=A100081384&amp;amp;l=99999&amp;amp;l_cd1=0&amp;amp;l_cd2=1&amp;amp;u_id=landingpage&amp;amp;tu=http%3A%2F%2Fproduct.dangdang.com%2Fproduct.aspx%3Fproduct_id%3D20637365" target="_blank"&gt;Landing Page优化权威指南&lt;span  style="font-family: verdana, 'courier new'; font-size: 14px; font-weight: normal; line-height: 21px; "&gt;&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;span  style="font-family: verdana, 'courier new'; font-size: 14px; font-weight: normal; line-height: 21px; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;当当有这本书：&lt;a href="http://click.linktech.cn/?m=dangdang&amp;amp;a=A100081384&amp;amp;l=99999&amp;amp;l_cd1=0&amp;amp;l_cd2=1&amp;amp;u_id=landingpage&amp;amp;tu=http%3A%2F%2Fproduct.dangdang.com%2Fproduct.aspx%3Fproduct_id%3D20637365" target="_blank"&gt;http://product.dangdang.com/product.aspx?product_id=20637365&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/shawnliu/aggbug/1696375.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/shawnliu/archive/2010/03/25/1696375.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/shawnliu/archive/2010/01/28/1657997.html</id><title type="text">sql server apply与 join等的区别</title><summary type="text">cross apply和outer apply和join很相似都是主要在做m*n笛卡尔集，比较显著特征是没有用到Join的ON连接了想想也比较合理，apply应用场景应该是满足join的约束，主要应该是例如返回表变量的函数，貌似还是没区分清楚，举个例子，返回一个customer最近的三个订单或者返回所有类别最热的5个产品这里top N操作如果用JOIN来搞就不好搞了 哈哈 不过也不是不可以搞 用r...</summary><published>2010-01-27T16:26:00Z</published><updated>2010-01-27T16:26:00Z</updated><author><name>shawnliu</name><uri>http://www.cnblogs.com/shawnliu/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shawnliu/archive/2010/01/28/1657997.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shawnliu/archive/2010/01/28/1657997.html"/></entry><entry><id>http://www.cnblogs.com/shawnliu/archive/2010/01/22/1654451.html</id><title type="text">老是在select中丢掉了NOLOCK有啥后果？？？deadlock ooo</title><summary type="text">不使用NOLOCK和READPAST，在Select操作时候则有可能报错误：事务(进程ID**)与另一个进程被死锁在锁资源上，并且已被选作死锁牺牲品。</summary><published>2010-01-22T13:04:00Z</published><updated>2010-01-22T13:04:00Z</updated><author><name>shawnliu</name><uri>http://www.cnblogs.com/shawnliu/</uri></author><link rel="alternate" href="http://www.cnblogs.com/shawnliu/archive/2010/01/22/1654451.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/shawnliu/archive/2010/01/22/1654451.html"/></entry></feed>
