在.NET项目中使用log4net
log4net是Apache开发的一个用于.NET应用程序的logger工具,log4net是开源的,使用Apache License, Version 2.0开源协议。 Read more...
使用InternalsVisibleTo给assembly添加“友元assembly”
C#的internal关键字可以使标记的方法,字段或者属性等等只能在当前assembly内部使用,那么如果其他的assembly需要使用这个internal的方法的时候怎么办呢?.NET提供了一种类似于C++中的友元类的方式来完成这个功能,那就是使用InternalsVisibleTo。 Read more...
性能: 字符串倒序算法 (C# version)
C#中有个string类型,是个很特殊的reference type, 存储在内存中一个特殊的“静态池”中,这里是MSDN关于string的介绍:http://msdn.microsoft.com/zh-cn/library/362314fe(VS.80).aspx Read more...
Update the application configuration file automatically in C#
The structure of an application’s configuration file always include: Read more...
DotNet下NUnit的使用(2)—- 第一个NUnit工程
准备工作
1. 打开visual studio, 新建一个“Class Library”工程,命名为“NUnitDemo”
2. 在工程中新建一个Class:“FirstNUnitClass”, 在类中添加一个public的方法:GetBonous(int level), 最终类的内容: Read more...
DotNet下NUnit的使用(1)—- NUnit入门
- 什么是Nunit
NUnit 是一个单元测试框架,可以用于所有的.Net语言,与JUnit类似,可以用来很方便的进行单元测试,NUnit是完全用C#语言编写而成,使用NUnit,您可以只需在您的代码上加上简单的'Attribute'就可以进行单元测试,目前NUnit的最新稳定版本是 2.4.8 (下载 ), 下面是来自就NUnit官方的介绍:
NUnit is a unit-testing framework for all .Net languages. Initially ported from JUnit, the current production release, version 2.4, is the fifth major release of this xUnit based unit testing tool for Microsoft .NET. It is written entirely in C# and has been completely redesigned to take advantage of many .NET language features, for example custom attributes and other reflection related capabilities. NUnit brings xUnit to all .NET languages.
Read more...