2007年8月10日
- 允许通过Build Toolbar选择"Debug" or "Relese"设置
"工具" -> "选项..." -> 选择"显示所有设置" -> "项目和解决方案" ->选择"显示高级生成配置"
- 在VS2k5 Express工程中使用NUnit-GUI测试(以Visual C# 2005 Express为例)
- 创建一个新的类库工程。

- 添加NUnit框架引用。
- 编写测试代码。
using System;
using NUnit.Framework;
namespace NUnitTest
{
[TestFixture]
public class Class1
{
[Test]
public void Test1()
{
int a = 1;
int b = 2;
int sum = a + b;
Assert.AreEqual(sum, 3);
}
}
}
- 使用NUnit-GUI测试。这一步需要修改.csproj文件,加入下面代码:
<PropertyGroup>
<Nunit_Path Condition="'$(NUNIT_PATH)' == ''">C:\Program Files\NUnit 2.4.2</Nunit_Path>
<StartAction>Program</StartAction>
<StartProgram>$(NUNIT_PATH)\bin\nunit.exe</StartProgram>
<StartArguments>/run $(TargetFileName)</StartArguments>
<!--.csproj.user overwrites those values!-->
</PropertyGroup>
重新加载工程,F5
2007年8月3日
原来一直在Ubuntu 7.04下使用MonoDevelop 0.12,今天偶然发现MonoDevelop已经升级到0.14了。马上升级!!
http://www.getdeb.net/search.php?keywords=monodevelop
2007年8月2日
我的CNBlogs已经荒废太久了!!
使用Windows Live Writer发布blog,试试效果。
2006年11月22日
看了
apan的《
CardViewer系列之准备篇--资源下载推荐》之后,也把自己常用的资料整理一下。
apan推荐的几本书都是值得一读的。
2006年10月25日
正常情况下,下面的代码:
namespace ClassLibrary1 {
public class Class1 {
private bool _bFlag;
public Class1() {
_bFlag = true;
}
}
}
产生的IL代码应该是:
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
// 代码大小 14 (0xe)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ldarg.0
IL_0007: ldc.i4.1
IL_0008: stfld bool ClassLibrary1.Class1::_bFlag
IL_000d: ret
} // end of method Class1::.ctor
可是,我见到这样一段代码:
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
// 代码大小 14 (0xe)
.maxstack 2
IL_0000: ldarg.0
IL_0001: ldc.i4.1
IL_0002: stfld bool ClassLibrary1.Class1::_bFlag
IL_0007: ldarg.0
IL_0008: call instance void [mscorlib]System.Object::.ctor()
IL_000d: ret
} // end of method Class1::.ctor
什么样的C#代码可以生产这样的IL呢?
先给变量赋值,然后才调用基类的构造函数。
找到原因了!谢谢提示。
C#代码是这样的:
namespace ClassLibrary1 {
public class Class1 {
private bool _bFlag = true;
}
}
这时系统就会先给变量赋值,再去调用基类的构造函数。
2006年10月9日
首先对被遗弃的小指赞一个!!!
赞的不仅是他的文章还有他的人品。
因为新的项目开始,我两个很菜的问题没有解决,实在不愿意在网上找了,累了。
看被遗弃的小指的Messenger一直示忙,就发了Email,都得到了耐心、细致回复。谢谢!
关于Code Snippet的使用问题,如果还有朋友有不清楚的地方,请参考:
http://www.cnblogs.com/shanyou/archive/2006/08/13/codesnippets.html
http://www.cnblogs.com/tonyqus/archive/2006/06/29/437928.html
我想说的是面对今天的Inertnet, 你们茫然吗?
早晨八点上班,带上耳机,响起节奏强劲舞曲。让节拍控制身体,眼前的东西渐渐清晰了。
打开Firefox,伴随着Firefox,Gmail、Google Reader、Writely一一跳了出来。看看每个标签上标题,括号里的数字不是三五十就是(100+)。
打开Windows Live Mail Desktop,哇!吓我一跳,黑色粗体的Email满屏都是。颤抖的手,不敢去点"News"。
打开Maxthon2,屏幕狂闪,呵呵~~ 打开如此之多的标签,以至于我看不清每张网页的标题。摇摇头,昨天还剩下这么多东西没来得及看完呀。。。
今天又接新项目,应用到的技术又是似乎熟悉却又陌生的。没办法了,把当前Maxthon2的标签存在组里吧,以后再看。
Ctrl+T开一个新标签,输入www.google.com ……
邮件到达提醒、RSS订阅提醒、新闻组、BBS、小企鹅在晃动、小人在闪……
我一直是醒着的!
2006年9月21日
2006年9月18日
摘要: From: http://www.dotnetrix.co.uk/tabcontrols.html1usingSystem.ComponentModel;2usingSystem.Drawing;3usingSystem.Windows.Forms;45namespaceDotnetrix.Samples.CSharp6{7[ToolboxBitmap(typeof(System.Windows....
阅读全文
2006年9月16日
参考: http://bluehouse.wordpress.com/2006/01/24/how-to-create-a-notify-icon-in-c-without-a-form/
Tested with .NET Framework 2.0 and Windows XP Professional SP2.
我想创建一个带Notify Icon的应用程序,但是不需要Forms。那么如何编写一个没有窗体的NotifyIcon程序哪?我找到了 http://bluehouse.wordpress.com/2006/01/24/how-to-create-a-notify-icon-in-c-without-a-form/ 。稍做修改,形成如下代码:
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using System.Windows.Forms;
5 using System.ComponentModel;
6 using System.Drawing;
7
8 class Portal
9 {
10 private IContainer container;
11 private NotifyIcon notifyIcon;
12
13 public Portal()
14 {
15 Icon icon = new Icon(SystemIcons.Application, 16, 16);
16
17 this.container = new Container();
18 this.notifyIcon = new NotifyIcon(this.container);
19 this.notifyIcon.Icon = icon;
20 this.notifyIcon.Visible = true;
21 }
22 }
23
24 static class Program
25 {
26 [STAThread]
27 static void Main()
28 {
29 new Portal();
30 Application.Run();
31 }
32 }
2006年4月21日
因为没备案, 被关了...... :-(
没有没比较好的国外空间推荐??